Skip to content

Commit 2058151

Browse files
committed
ActiveRecord::JDBCError needs to have pool associated with it
1 parent f78b180 commit 2058151

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/arjdbc/abstract/core.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ def translate_exception(exception, message:, sql:, binds:)
5252
# swallow an ArJdbc / driver bug into an AR::StatementInvalid !
5353
return exception if exception.is_a?(Throwable)
5454

55+
# We create this exception in Java where we do not have access to the pool
56+
exception.instance_variable_set(:@connection_pool, @pool) if exception.kind_of?(::ActiveRecord::JDBCError)
57+
5558
case exception
5659
when SystemExit, SignalException, NoMemoryError then exception
5760
when ActiveModel::RangeError, TypeError, RuntimeError then exception

0 commit comments

Comments
 (0)