Repository: cayenne
Updated Branches:
  refs/heads/master 99b282838 -> 9d2097736


meditating on the sybase connection management hack


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/9d209773
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/9d209773
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/9d209773

Branch: refs/heads/master
Commit: 9d20977369be924a77e4eba10d83e63954f0c116
Parents: 99b2828
Author: aadamchik <[email protected]>
Authored: Sun May 3 07:37:44 2015 -0400
Committer: aadamchik <[email protected]>
Committed: Sun May 3 07:37:44 2015 -0400

----------------------------------------------------------------------
 .../org/apache/cayenne/datasource/PoolingDataSource.java     | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/9d209773/cayenne-server/src/main/java/org/apache/cayenne/datasource/PoolingDataSource.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/datasource/PoolingDataSource.java
 
b/cayenne-server/src/main/java/org/apache/cayenne/datasource/PoolingDataSource.java
index bb7f732..88ece22 100644
--- 
a/cayenne-server/src/main/java/org/apache/cayenne/datasource/PoolingDataSource.java
+++ 
b/cayenne-server/src/main/java/org/apache/cayenne/datasource/PoolingDataSource.java
@@ -56,7 +56,13 @@ public class PoolingDataSource implements DataSource {
 
                String s = e.getMessage().toLowerCase();
                if (s.contains("set chained command not allowed")) {
-                       // TODO: the hack is ugly... should we rollback instead 
here?
+
+                       // TODO: doing 'commit' here is extremely dangerous... 
we need to
+                       // get a hold of Sybase instance and verify whether 
this issue is
+                       // still there, and fix it differently (and perhaps 
generically) by
+                       // calling 'rollback' on connections (can we do it when 
getting
+                       // connection from the pool? returning it to the pool?)
+
                        c.commit();
                        c.setAutoCommit(autoCommit); // Shouldn't fail now.
                } else {

Reply via email to