mirror of https://github.com/apache/openjpa.git
OPENJPA-622 Informix -lock timieout, cursor not open problem for NonJTA datasource transaction RESOURCE_LOCAL in JEE
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@663358 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1fda19f8b7
commit
8a80d753a3
|
@ -238,15 +238,6 @@ public class DB2Dictionary
|
||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isJDBC3(DatabaseMetaData meta) {
|
|
||||||
try {
|
|
||||||
// JDBC3-only method, so it might throw a AbstractMethodError
|
|
||||||
return meta.getJDBCMajorVersion() >= 3;
|
|
||||||
} catch (Throwable t) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void connectedConfiguration(Connection conn) throws SQLException {
|
public void connectedConfiguration(Connection conn) throws SQLException {
|
||||||
super.connectedConfiguration(conn);
|
super.connectedConfiguration(conn);
|
||||||
|
|
||||||
|
@ -266,7 +257,7 @@ public class DB2Dictionary
|
||||||
}
|
}
|
||||||
|
|
||||||
if (db2ServerType == 0) {
|
if (db2ServerType == 0) {
|
||||||
if (isJDBC3(metaData)) {
|
if (isJDBC3) {
|
||||||
maj = metaData.getDatabaseMajorVersion();
|
maj = metaData.getDatabaseMajorVersion();
|
||||||
min = metaData.getDatabaseMinorVersion();
|
min = metaData.getDatabaseMinorVersion();
|
||||||
}
|
}
|
||||||
|
|
|
@ -327,6 +327,7 @@ public class DBDictionary
|
||||||
protected JDBCConfiguration conf = null;
|
protected JDBCConfiguration conf = null;
|
||||||
protected Log log = null;
|
protected Log log = null;
|
||||||
protected boolean connected = false;
|
protected boolean connected = false;
|
||||||
|
protected boolean isJDBC3 = false;
|
||||||
protected final Set reservedWordSet = new HashSet();
|
protected final Set reservedWordSet = new HashSet();
|
||||||
protected final Set systemSchemaSet = new HashSet();
|
protected final Set systemSchemaSet = new HashSet();
|
||||||
protected final Set systemTableSet = new HashSet();
|
protected final Set systemTableSet = new HashSet();
|
||||||
|
@ -374,27 +375,28 @@ public class DBDictionary
|
||||||
public void connectedConfiguration(Connection conn)
|
public void connectedConfiguration(Connection conn)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
if (!connected) {
|
if (!connected) {
|
||||||
DatabaseMetaData metaData = null;
|
DatabaseMetaData metaData = null;
|
||||||
try {
|
try {
|
||||||
if (log.isTraceEnabled()) {
|
metaData = conn.getMetaData();
|
||||||
metaData = conn.getMetaData();
|
try {
|
||||||
boolean isJDBC3 = false;
|
// JDBC3-only method, so it might throw a
|
||||||
log.trace(DBDictionaryFactory.toString
|
// AbstractMethodError
|
||||||
(metaData));
|
isJDBC3 = metaData.getJDBCMajorVersion() >= 3;
|
||||||
try {
|
} catch (Throwable t) {
|
||||||
// JDBC3-only method, so it might throw a
|
// ignore if not JDBC3
|
||||||
// AbstractMethodError
|
|
||||||
isJDBC3 = metaData.getJDBCMajorVersion() >= 3;
|
|
||||||
} catch (Throwable t) {
|
|
||||||
// ignore if not JDBC3
|
|
||||||
}
|
|
||||||
if (isJDBC3)
|
|
||||||
log.trace(_loc.get("connection-defaults", new Object[]{
|
|
||||||
conn.getAutoCommit(), conn.getHoldability(),
|
|
||||||
conn.getTransactionIsolation()}));
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.trace(e.toString(), e);
|
if (log.isTraceEnabled())
|
||||||
|
log.trace(e.toString(), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (log.isTraceEnabled()) {
|
||||||
|
log.trace(DBDictionaryFactory.toString(metaData));
|
||||||
|
|
||||||
|
if (isJDBC3)
|
||||||
|
log.trace(_loc.get("connection-defaults", new Object[]{
|
||||||
|
conn.getAutoCommit(), conn.getHoldability(),
|
||||||
|
conn.getTransactionIsolation()}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
connected = true;
|
connected = true;
|
||||||
|
|
|
@ -121,7 +121,6 @@ public class InformixDictionary
|
||||||
}));
|
}));
|
||||||
|
|
||||||
supportsQueryTimeout = false;
|
supportsQueryTimeout = false;
|
||||||
supportsMultipleNontransactionalResultSets = false;
|
|
||||||
supportsLockingWithDistinctClause = false;
|
supportsLockingWithDistinctClause = false;
|
||||||
supportsLockingWithMultipleTables = false;
|
supportsLockingWithMultipleTables = false;
|
||||||
supportsLockingWithOrderClause = false;
|
supportsLockingWithOrderClause = false;
|
||||||
|
@ -161,6 +160,13 @@ public class InformixDictionary
|
||||||
else
|
else
|
||||||
driverVendor = VENDOR_OTHER;
|
driverVendor = VENDOR_OTHER;
|
||||||
}
|
}
|
||||||
|
if (isJDBC3) {
|
||||||
|
conn.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
|
||||||
|
if (log.isTraceEnabled())
|
||||||
|
log.trace(_loc.get("connection-defaults", new Object[]{
|
||||||
|
conn.getAutoCommit(), conn.getHoldability(),
|
||||||
|
conn.getTransactionIsolation()}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Column[] getColumns(DatabaseMetaData meta, String catalog,
|
public Column[] getColumns(DatabaseMetaData meta, String catalog,
|
||||||
|
|
Loading…
Reference in New Issue