Skip to content

Commit b385ef5

Browse files
committed
synchronize init_connection (all public methods doing newConnection sync)
1 parent 14e5cf2 commit b385ef5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/java/arjdbc/jdbc/RubyJdbcConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public IRubyObject set_connection_factory(final ThreadContext context, final IRu
444444
* @return connection
445445
*/
446446
@JRubyMethod(name = "init_connection")
447-
public IRubyObject init_connection(final ThreadContext context) throws SQLException {
447+
public synchronized IRubyObject init_connection(final ThreadContext context) throws SQLException {
448448
final IRubyObject jdbcConnection = setConnection( newConnection() );
449449
final IRubyObject adapter = callMethod("adapter"); // self.adapter
450450
if ( ! adapter.isNil() ) {

0 commit comments

Comments
 (0)