From teiid-commits at lists.jboss.org Thu May 1 11:58:50 2014
Content-Type: multipart/mixed; boundary="===============4728649994724060274=="
MIME-Version: 1.0
From: teiid-commits at lists.jboss.org
To: teiid-commits at lists.jboss.org
Subject: [teiid-commits] teiid SVN: r4638 - in branches/7.7.x:
client/src/main/java/org/teiid/jdbc and 1 other directories.
Date: Thu, 01 May 2014 11:58:50 -0400
Message-ID: <201405011558.s41FwoQi001266@svn01.web.mwc.hst.phx2.redhat.com>
--===============4728649994724060274==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: jolee
Date: 2014-05-01 11:58:50 -0400 (Thu, 01 May 2014)
New Revision: 4638
Modified:
branches/7.7.x/build/kits/jboss-container/teiid-releasenotes.html
branches/7.7.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
branches/7.7.x/client/src/test/java/org/teiid/jdbc/TestStatement.java
Log:
BZ1054940 - Roll up patch EDS_5.3.1_1_2014 + TEIID-2945 allowing disableLoc=
alTxn to work via a set statement
Modified: branches/7.7.x/build/kits/jboss-container/teiid-releasenotes.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/7.7.x/build/kits/jboss-container/teiid-releasenotes.html 2014-=
04-24 12:09:46 UTC (rev 4637)
+++ branches/7.7.x/build/kits/jboss-container/teiid-releasenotes.html 2014-=
05-01 15:58:50 UTC (rev 4638)
@@ -256,6 +256,8 @@
[TEIID-2931=
] - Perform equi-join full outer joins in a streaming manner
+[TEIID-2945=
] - disableLocalTxn only works at connection time
+
From 7.7.9
Modified: branches/7.7.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl=
.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/7.7.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java =
2014-04-24 12:09:46 UTC (rev 4637)
+++ branches/7.7.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java =
2014-05-01 15:58:50 UTC (rev 4638)
@@ -88,7 +88,6 @@
// Flag to represent if the connection state needs to be readOnly, de=
fault value false.
private boolean readOnly =3D false;
=
- private boolean disableLocalTransactions =3D false;
private DQP dqp;
protected ServerConnection serverConn;
private int transactionIsolation =3D DEFAULT_ISOLATION;
@@ -112,8 +111,6 @@
logConnectionProperties(url, info);
=
setExecutionProperties(info);
- =
- this.disableLocalTransactions =3D Boolean.valueOf(this.propInfo.ge=
tProperty(ExecutionProperties.DISABLE_LOCAL_TRANSACTIONS)).booleanValue();
}
=
boolean isInLocalTxn() {
@@ -358,8 +355,12 @@
}
=
void beginLocalTxnIfNeeded() throws SQLException {
- if (this.transactionXid !=3D null || inLocalTxn || this.autoCommit=
Flag || disableLocalTransactions) {
+ if (this.transactionXid !=3D null || inLocalTxn || this.autoCommit=
Flag) {
return;
+ }
+ String prop =3D this.propInfo.getProperty(ExecutionProperties.DISA=
BLE_LOCAL_TRANSACTIONS);
+ if (prop !=3D null && Boolean.valueOf(prop)) {
+ return;
}
try {
try {
Modified: branches/7.7.x/client/src/test/java/org/teiid/jdbc/TestStatement.=
java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/7.7.x/client/src/test/java/org/teiid/jdbc/TestStatement.java 2=
014-04-24 12:09:46 UTC (rev 4637)
+++ branches/7.7.x/client/src/test/java/org/teiid/jdbc/TestStatement.java 2=
014-05-01 15:58:50 UTC (rev 4638)
@@ -38,6 +38,7 @@
import org.teiid.client.RequestMessage;
import org.teiid.client.ResultsMessage;
import org.teiid.client.util.ResultsFuture;
+import org.teiid.net.ServerConnection;
=
@SuppressWarnings("nls")
public class TestStatement {
@@ -113,6 +114,23 @@
assertFalse(statement.execute("rollback")); //$NON-NLS-1$
Mockito.verify(conn).rollback(false);
}
+ =
+ @Test public void testDisableLocalTransations() throws Exception {
+ ServerConnection mock =3D Mockito.mock(ServerConnection.class);
+ Mockito.stub(mock.getService(DQP.class)).toReturn(Mockito.mock(DQP.class=
));
+ ConnectionImpl conn =3D new ConnectionImpl(mock, new Properties(), "x");
+ StatementImpl statement =3D new StatementImpl(conn, ResultSet.TYPE_FORWA=
RD_ONLY, ResultSet.CONCUR_READ_ONLY);
+ assertTrue(conn.getAutoCommit());
+ statement.execute("set disablelocaltxn true");
+ assertFalse(statement.execute("start transaction")); //$NON-NLS-1$
+ conn.beginLocalTxnIfNeeded();
+ assertFalse(conn.isInLocalTxn());
+ =
+ statement.execute("set disablelocaltxn false");
+ assertFalse(statement.execute("start transaction")); //$NON-NLS-1$
+ conn.beginLocalTxnIfNeeded();
+ assertTrue(conn.isInLocalTxn());
+ }
=
@SuppressWarnings("unchecked")
@Test public void testTransactionStatementsAsynch() throws Exception {
--===============4728649994724060274==--