use of org.talend.repository.nosql.exceptions.NoSQLServerException in project tbd-studio-se by Talend.
the class ExecutionUnitWithTransaction method execute.
public Object execute(Object db) throws NoSQLServerException {
Object result = null;
try {
Object tx = // $NON-NLS-1$
NoSQLReflection.invokeMethod(// $NON-NLS-1$
db, // $NON-NLS-1$
"beginTx", new Object[0]);
try {
result = run();
// $NON-NLS-1$
NoSQLReflection.invokeMethod(// $NON-NLS-1$
tx, // $NON-NLS-1$
"success", new Object[0]);
} finally {
// $NON-NLS-1$
NoSQLReflection.invokeMethod(// $NON-NLS-1$
tx, // $NON-NLS-1$
"close", new Object[0]);
}
} catch (Exception e) {
throw new NoSQLServerException(e);
}
return result;
}
Aggregations