Search in sources :

Example 36 with NoSQLServerException

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;
}
Also used : NoSQLServerException(org.talend.repository.nosql.exceptions.NoSQLServerException) NoSQLServerException(org.talend.repository.nosql.exceptions.NoSQLServerException)

Aggregations

NoSQLServerException (org.talend.repository.nosql.exceptions.NoSQLServerException)36 NoSQLReflectionException (org.talend.repository.nosql.exceptions.NoSQLReflectionException)33 ArrayList (java.util.ArrayList)13 ContextType (org.talend.designer.core.model.utils.emf.talendfile.ContextType)13 ASN1Object (org.bouncycastle.asn1.ASN1Object)9 JSONObject (org.talend.utils.json.JSONObject)9 List (java.util.List)7 JSONException (org.talend.utils.json.JSONException)6 HashSet (java.util.HashSet)5 HashMap (java.util.HashMap)4 Map (java.util.Map)4 SSLContext (javax.net.ssl.SSLContext)3 File (java.io.File)2 Collection (java.util.Collection)2 Iterator (java.util.Iterator)2 MappingTypeRetriever (org.talend.core.model.metadata.MappingTypeRetriever)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 FileInputStream (java.io.FileInputStream)1 InputStream (java.io.InputStream)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1