We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cd1c60 commit c24b09bCopy full SHA for c24b09b
lib/arjdbc/postgresql/adapter.rb
@@ -481,11 +481,16 @@ def write_query?(sql) # :nodoc:
481
# end
482
483
def reset!
484
- clear_cache!
485
- reset_transaction
486
- @connection.rollback # Have to deal with rollbacks differently than the AR adapter
487
- @connection.execute 'DISCARD ALL'
488
- @connection.configure_connection
+ @lock.synchronize do
+ return connect! unless @raw_connection
+
+ # Have to deal with rollbacks differently than the AR adapter
+ @raw_connection.rollback
489
490
+ @raw_connection.execute("DISCARD ALL")
491
492
+ super
493
+ end
494
end
495
496
def default_sequence_name(table_name, pk = "id") #:nodoc:
0 commit comments