use of org.apache.cayenne.tx.ExternalTransaction in project cayenne by apache.
the class DataContextProcedureQueryIT method runProcedureSelect.
protected List<DataRow> runProcedureSelect(ProcedureQuery q) throws Exception {
// Sybase blows whenever a transaction wraps a SP, so turn off
// transactions
// TODO: it is quite the opposite with PostgreSQL. If an SP returns an
// open refcursor, it actually expects a TX in progress, so while we
// don't have refcursor unit tests, this is something to keep in mind
// e.g.
// http://stackoverflow.com/questions/16921942/porting-apache-cayenne-from-oracle-to-postgresql
BaseTransaction t = new ExternalTransaction(jdbcEventLogger);
BaseTransaction.bindThreadTransaction(t);
try {
return context.performQuery(q);
} finally {
BaseTransaction.bindThreadTransaction(null);
t.commit();
}
}
Aggregations