Skip to content

Commit 9e73177

Browse files
committed
Move these up to abstract adapter
Needed by the others as well
1 parent d3c27cb commit 9e73177

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lib/arjdbc/abstract/connection_management.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ def disconnect!
3636
# end
3737
# end
3838

39+
# DIFFERENCE: we delve into jdbc shared code and this does self.class.new_client.
40+
def connect
41+
@raw_connection = jdbc_connection_class(@config[:adapter_spec]).new(@config, self)
42+
@raw_connection.configure_connection
43+
end
44+
45+
def reconnect
46+
if active?
47+
@raw_connection.rollback rescue nil
48+
else
49+
connect
50+
end
51+
end
52+
3953
end
4054
end
4155
end

lib/arjdbc/sqlite3/adapter.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -669,20 +669,6 @@ def build_statement_pool
669669
StatementPool.new(self.class.type_cast_config_to_integer(@config[:statement_limit]))
670670
end
671671

672-
# DIFFERENCE: we delve into jdbc shared code and this does self.class.new_client.
673-
def connect
674-
@raw_connection = jdbc_connection_class(@config[:adapter_spec]).new(@config, self)
675-
@raw_connection.configure_connection
676-
end
677-
678-
def reconnect
679-
if active?
680-
@raw_connection.rollback rescue nil
681-
else
682-
connect
683-
end
684-
end
685-
686672
def configure_connection
687673
if @config[:timeout] && @config[:retries]
688674
raise ArgumentError, "Cannot specify both timeout and retries arguments"

0 commit comments

Comments
 (0)