You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2016/02/06 16:51:06 UTC
[17/34] jena git commit: Avoid constructor circularity when txn level
is not NONE.
Avoid constructor circularity when txn level is not NONE.
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/59821dfc
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/59821dfc
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/59821dfc
Branch: refs/heads/master
Commit: 59821dfc0dd59f797d6195138eac50bf35874c93
Parents: a09b30d
Author: Andy Seaborne <an...@apache.org>
Authored: Fri Feb 5 11:26:14 2016 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Fri Feb 5 19:17:32 2016 +0000
----------------------------------------------------------------------
.../org/apache/jena/jdbc/mem/connections/MemConnection.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/59821dfc/jena-jdbc/jena-jdbc-driver-mem/src/main/java/org/apache/jena/jdbc/mem/connections/MemConnection.java
----------------------------------------------------------------------
diff --git a/jena-jdbc/jena-jdbc-driver-mem/src/main/java/org/apache/jena/jdbc/mem/connections/MemConnection.java b/jena-jdbc/jena-jdbc-driver-mem/src/main/java/org/apache/jena/jdbc/mem/connections/MemConnection.java
index 34c33db..bef8a94 100644
--- a/jena-jdbc/jena-jdbc-driver-mem/src/main/java/org/apache/jena/jdbc/mem/connections/MemConnection.java
+++ b/jena-jdbc/jena-jdbc-driver-mem/src/main/java/org/apache/jena/jdbc/mem/connections/MemConnection.java
@@ -52,7 +52,14 @@ public class MemConnection extends DatasetConnection {
*/
public MemConnection(Dataset ds, int holdability, boolean autoCommit, int transactionLevel, int compatibilityLevel)
throws SQLException {
- super(ds, holdability, autoCommit, transactionLevel, compatibilityLevel);
+ super(ds, holdability, autoCommit, TRANSACTION_NONE, compatibilityLevel);
+ // DatasetConnection extends JenaConnection
+ // JenaConnection.super calls setTransactionIsolation
+ // ... which calls DatasetConnection.checkTransactionIsolation
+ // ... which relies on DatasetConnection.ds being set if the transactionLevel isn't TRANSACTION_NONE
+ // ... which it isn't yet becaue during JenaConnection.super, the rest of DatasetConnection.super has not run.
+ // So set to TRANSACTION_NONE in super(), then set properly.
+ setTransactionIsolation(transactionLevel);
this.metadata = new MemDatasetMetadata(this);
}