[jboss-cvs] JBoss Messaging SVN: r2295 - trunk/src/main/org/jboss/messaging/core/plugin.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Feb 13 08:49:17 EST 2007
Author: timfox
Date: 2007-02-13 08:49:16 -0500 (Tue, 13 Feb 2007)
New Revision: 2295
Modified:
trunk/src/main/org/jboss/messaging/core/plugin/JDBCSupport.java
Log:
Need to execute each command in its own tx for postgresql
Modified: trunk/src/main/org/jboss/messaging/core/plugin/JDBCSupport.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/JDBCSupport.java 2007-02-13 12:40:59 UTC (rev 2294)
+++ trunk/src/main/org/jboss/messaging/core/plugin/JDBCSupport.java 2007-02-13 13:49:16 UTC (rev 2295)
@@ -203,14 +203,19 @@
Connection conn = null;
TransactionWrapper tx = new TransactionWrapper();
- try
+ // Postgresql will not process any further commands in a transaction
+ // after a create table fails:
+ // org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
+ // Therefore we need to ensure each CREATE is executed in its own transaction
+
+ Iterator iter = defaultDDLStatements.keySet().iterator();
+
+ while (iter.hasNext())
{
- conn = ds.getConnection();
-
- Iterator iter = defaultDDLStatements.keySet().iterator();
-
- while (iter.hasNext())
- {
+ try
+ {
+ conn = ds.getConnection();
+
String statementName = (String)iter.next();
String statement = getSQLStatement(statementName);
@@ -228,21 +233,21 @@
log.debug("Failed to execute: " + statement, e);
}
}
- }
- }
- finally
- {
- if (conn != null)
+ }
+ finally
{
- try
+ if (conn != null)
{
- conn.close();
+ try
+ {
+ conn.close();
+ }
+ catch (Throwable t)
+ {}
}
- catch (Throwable t)
- {}
- }
- tx.end();
- }
+ tx.end();
+ }
+ }
}
// Innner classes ---------------------------------------------------------
More information about the jboss-cvs-commits
mailing list