Fix for #235: Stored procedures not commited

This commit is contained in:
rbygrave
2015-02-03 00:01:18 +13:00
parent 6a582c0eef
commit c638ad8d56
4 changed files with 69 additions and 8 deletions
@@ -212,6 +212,11 @@ public interface SpiTransaction extends Transaction {
*/
public void flushBatchOnCascade();
/**
* Mark the transaction explicitly as not being query only.
*/
public void markNotQueryOnly();
/**
* Potentially escalate batch mode on saving or deleting a collection.
*/
@@ -222,4 +227,5 @@ public interface SpiTransaction extends Transaction {
*/
public void flushBatchOnCollection();
}
@@ -76,13 +76,6 @@ public final class PersistRequestCallableSql extends PersistRequest {
public void setGeneratedKey(Object idValue) {
}
/**
* False for CallableSql.
*/
public boolean useGeneratedKeys() {
return false;
}
/**
* Perform post execute processing for the CallableSql.
*/
@@ -98,6 +91,8 @@ public final class PersistRequestCallableSql extends PersistRequest {
if (tableEvents != null && !tableEvents.isEmpty()) {
transaction.getEvent().add(tableEvents);
} else {
transaction.markNotQueryOnly();
}
}
@@ -141,7 +136,7 @@ public final class PersistRequestCallableSql extends PersistRequest {
for (int i = 0; i < list.size(); i++) {
pos++;
BindParams.Param param = (BindParams.Param) list.get(i);
BindParams.Param param = list.get(i);
if (param.isOutParam()) {
Object outValue = cstmt.getObject(pos);
param.setOutValue(outValue);
@@ -361,6 +361,11 @@ public class JdbcTransaction implements SpiTransaction {
return depth;
}
@Override
public void markNotQueryOnly() {
this.queryOnly = false;
}
@Override
public boolean isReadOnly() {
if (!isActive()) {