if (conn.getAutoCommit()==false)
conn.commit();
// obtain output mode module and rollback output
ServiceSelector outputSelector = null;
OutputModule output = null;
try {
outputSelector = (ServiceSelector) this.manager.lookup(OUTPUT_MODULE_SELECTOR);
if (outputMode != null && outputSelector != null && outputSelector.isSelectable(outputMode)){
output = (OutputModule) outputSelector.select(outputMode);
}
output.commit(null, objectModel);
} catch (Exception e) {
if (getLogger().isWarnEnabled()) {
getLogger().warn("Could not select output mode "
+ outputMode + ":" + e.getMessage());
}
} finally {
if (outputSelector != null) {
if (output != null)
outputSelector.release(output);
this.manager.release(outputSelector);
}
}
} catch (Exception e) {
failed = true;
if ( conn != null ) {
try {
if (getLogger().isDebugEnabled()) {
getLogger().debug( "Rolling back transaction. Caused by " + e.getMessage() );
e.printStackTrace();
}
conn.rollback();
results = null;
// obtain output mode module and commit output
ServiceSelector outputSelector = null;
OutputModule output = null;
try {
outputSelector = (ServiceSelector) this.manager.lookup(OUTPUT_MODULE_SELECTOR);
if (outputMode != null && outputSelector != null && outputSelector.isSelectable(outputMode)){
output = (OutputModule) outputSelector.select(outputMode);
}
output.rollback( null, objectModel, e);
} catch (Exception e2) {
if (getLogger().isWarnEnabled()) {
getLogger().warn("Could not select output mode "
+ outputMode + ":" + e2.getMessage());
}
} finally {
if (outputSelector != null) {
if (output != null)
outputSelector.release(output);
this.manager.release(outputSelector);
}
}
} catch (SQLException se) {