[Mulgara-svn] r1732 - trunk/src/jar/querylang/java/org/mulgara/protocol/http
pag at mulgara.org
pag at mulgara.org
Thu Jun 11 00:24:42 UTC 2009
Author: pag
Date: 2009-06-10 17:24:41 -0700 (Wed, 10 Jun 2009)
New Revision: 1732
Modified:
trunk/src/jar/querylang/java/org/mulgara/protocol/http/ProtocolServlet.java
Log:
Picking up when an HTTP access tries to leave a transaction open and closes it
Modified: trunk/src/jar/querylang/java/org/mulgara/protocol/http/ProtocolServlet.java
===================================================================
--- trunk/src/jar/querylang/java/org/mulgara/protocol/http/ProtocolServlet.java 2009-06-11 00:23:53 UTC (rev 1731)
+++ trunk/src/jar/querylang/java/org/mulgara/protocol/http/ProtocolServlet.java 2009-06-11 00:24:41 UTC (rev 1732)
@@ -480,6 +480,10 @@
try {
try {
for (Command cmd: cmds) {
+ // if a transaction is being created, we need to know about it
+ if (!tx && cmd instanceof SetAutoCommit) {
+ tx = !((SetAutoCommit)cmd).isOn();
+ }
tmpResult = executeCommand(cmd, req);
tmpOutputType = getOutputType(req, cmd);
// remember the last answer we see
@@ -507,7 +511,7 @@
} finally {
// always turn on autocommit since we can't leave a transaction running in HTTP
try {
- executeCommand(new SetAutoCommit(true), req);
+ if (tx) executeCommand(new SetAutoCommit(true), req);
} catch (Exception e) {
// throw away
logger.error("Unable to close transaction", e);
More information about the Mulgara-svn
mailing list