Permalink
Browse files

Remove code that changes the behavior of nested transactions since it…

… doesn't work with postgresql and sqlite3 seems to be ok without it.
  • Loading branch information...
1 parent be67fd7 commit 6b624bfe02b456eb0a37353a9b0a22c06c3d8b2d @braintreeps committed Oct 27, 2011
Showing with 2 additions and 11 deletions.
  1. +2 −11 lib/data_fabric/connection_proxy.rb
View
13 lib/data_fabric/connection_proxy.rb
@@ -79,13 +79,8 @@ def initialize(model_class, options)
delegate :insert_many, :to => :master # ar-extensions bulk insert support
def transaction(start_db_transaction = true, &block)
- # Transaction is not re-entrant in SQLite 3 so we
- # need to track if we've already started an XA to avoid
- # calling it twice.
- return yield if in_transaction?
-
with_master do
- connection.transaction(start_db_transaction, &block)
+ connection.transaction(start_db_transaction, &block)
end
end
@@ -126,10 +121,6 @@ def current_pool
private
- def in_transaction?
- current_role == 'master'
- end
-
def spec_for(config)
# XXX This looks pretty fragile. Will break if AR changes how it initializes connections and adapters.
config = config.symbolize_keys
@@ -177,4 +168,4 @@ def master
end
end
-end
+end

0 comments on commit 6b624bf

Please sign in to comment.