Author: mvdb
Date: Wed Nov 9 09:36:59 2005
New Revision: 332087
URL: http://svn.apache.org/viewcvs?rev=332087&view=rev
Log:
Before committing, check if autocommit is turned on to prevent a sql exception
Modified:
db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java
Modified:
db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java
URL:
http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java?rev=332087&r1=332086&r2=332087&view=diff
==============================================================================
---
db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java
(original)
+++
db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java
Wed Nov 9 09:36:59 2005
@@ -732,7 +732,10 @@
// we'll have to commit the statement(s) because otherwise
most likely
// the auto increment hasn't happened yet (the db didn't
actually
// perform the insert yet so no triggering of sequences did
occur)
- connection.commit();
+ if (!connection.getAutoCommit())
+ {
+ connection.commit();
+ }
queryStmt = connection.createStatement();
lastInsertedIds = queryStmt.executeQuery(queryIdSql);