Skip to content

Commit

Permalink
Rewrite formerly synchronized NewProxyConnection.maybeDirtyTransactio…
Browse files Browse the repository at this point in the history
…n() in terms of ReentrantLock.
  • Loading branch information
swaldman committed May 4, 2024
1 parent d3fa06a commit 92d86e5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions proxy/src/com/mchange/v2/c3p0/codegen/JdbcProxyGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,16 @@ protected void generateExtraDeclarations( Class intfcl, String genclass, Indente
iw.downIndent();
iw.println("}");
iw.println();
iw.println("synchronized void maybeDirtyTransaction()");
iw.println("{ txn_known_resolved = false; }");
iw.println("void maybeDirtyTransaction()");
iw.println("{");
iw.upIndent();
iw.println("this.lock.lock();");
iw.println("try");
iw.println("{ txn_known_resolved = false; }");
iw.println("finally");
iw.println("{ this.lock.unlock(); }");
iw.downIndent();
iw.println("}");

super.generateExtraDeclarations( intfcl, genclass, iw );
}
Expand Down

0 comments on commit 92d86e5

Please sign in to comment.