Search in sources :

Example 16 with ISqlTransaction

use of org.jumpmind.db.sql.ISqlTransaction in project symmetric-ds by JumpMind.

the class OutgoingBatchService method insertOutgoingBatch.

public void insertOutgoingBatch(final OutgoingBatch outgoingBatch) {
    ISqlTransaction transaction = null;
    try {
        transaction = sqlTemplate.startSqlTransaction();
        insertOutgoingBatch(transaction, outgoingBatch);
        transaction.commit();
    } catch (Error ex) {
        if (transaction != null) {
            transaction.rollback();
        }
        throw ex;
    } catch (RuntimeException ex) {
        if (transaction != null) {
            transaction.rollback();
        }
        throw ex;
    } finally {
        close(transaction);
    }
}
Also used : ISqlTransaction(org.jumpmind.db.sql.ISqlTransaction)

Example 17 with ISqlTransaction

use of org.jumpmind.db.sql.ISqlTransaction in project symmetric-ds by JumpMind.

the class NodeService method updateNodeSecurity.

public boolean updateNodeSecurity(NodeSecurity security) {
    ISqlTransaction transaction = null;
    try {
        transaction = sqlTemplate.startSqlTransaction();
        boolean updated = updateNodeSecurity(transaction, security);
        transaction.commit();
        return updated;
    } catch (Error ex) {
        if (transaction != null) {
            transaction.rollback();
        }
        throw ex;
    } catch (RuntimeException ex) {
        if (transaction != null) {
            transaction.rollback();
        }
        throw ex;
    } finally {
        close(transaction);
    }
}
Also used : ISqlTransaction(org.jumpmind.db.sql.ISqlTransaction)

Example 18 with ISqlTransaction

use of org.jumpmind.db.sql.ISqlTransaction in project symmetric-ds by JumpMind.

the class NodeService method setInitialLoadEnabled.

public boolean setInitialLoadEnabled(String nodeId, boolean initialLoadEnabled, boolean syncChange, long loadId, String createBy) {
    ISqlTransaction transaction = null;
    try {
        transaction = sqlTemplate.startSqlTransaction();
        boolean updated = setInitialLoadEnabled(transaction, nodeId, initialLoadEnabled, syncChange, loadId, createBy);
        transaction.commit();
        return updated;
    } catch (Error ex) {
        if (transaction != null) {
            transaction.rollback();
        }
        throw ex;
    } catch (RuntimeException ex) {
        if (transaction != null) {
            transaction.rollback();
        }
        throw ex;
    } finally {
        close(transaction);
    }
}
Also used : ISqlTransaction(org.jumpmind.db.sql.ISqlTransaction)

Example 19 with ISqlTransaction

use of org.jumpmind.db.sql.ISqlTransaction in project symmetric-ds by JumpMind.

the class NodeService method setReverseInitialLoadEnabled.

public boolean setReverseInitialLoadEnabled(String nodeId, boolean initialLoadEnabled, boolean syncChange, long loadId, String createBy) {
    ISqlTransaction transaction = null;
    try {
        transaction = sqlTemplate.startSqlTransaction();
        boolean updated = setReverseInitialLoadEnabled(transaction, nodeId, initialLoadEnabled, syncChange, loadId, createBy);
        transaction.commit();
        return updated;
    } catch (Error ex) {
        if (transaction != null) {
            transaction.rollback();
        }
        throw ex;
    } catch (RuntimeException ex) {
        if (transaction != null) {
            transaction.rollback();
        }
        throw ex;
    } finally {
        close(transaction);
    }
}
Also used : ISqlTransaction(org.jumpmind.db.sql.ISqlTransaction)

Example 20 with ISqlTransaction

use of org.jumpmind.db.sql.ISqlTransaction in project symmetric-ds by JumpMind.

the class SequenceService method nextVal.

public long nextVal(String name) {
    ISqlTransaction transaction = null;
    try {
        transaction = sqlTemplate.startSqlTransaction();
        long val = nextVal(transaction, name);
        transaction.commit();
        return val;
    } catch (Error ex) {
        if (transaction != null) {
            transaction.rollback();
        }
        throw ex;
    } catch (RuntimeException ex) {
        if (transaction != null) {
            transaction.rollback();
        }
        throw ex;
    } finally {
        close(transaction);
    }
}
Also used : ISqlTransaction(org.jumpmind.db.sql.ISqlTransaction)

Aggregations

ISqlTransaction (org.jumpmind.db.sql.ISqlTransaction)53 Node (org.jumpmind.symmetric.model.Node)7 ArrayList (java.util.ArrayList)6 TriggerRouter (org.jumpmind.symmetric.model.TriggerRouter)6 ITriggerRouterService (org.jumpmind.symmetric.service.ITriggerRouterService)6 List (java.util.List)5 ISqlTemplate (org.jumpmind.db.sql.ISqlTemplate)5 ISymmetricDialect (org.jumpmind.symmetric.db.ISymmetricDialect)5 TriggerHistory (org.jumpmind.symmetric.model.TriggerHistory)5 SymmetricException (org.jumpmind.symmetric.SymmetricException)4 Trigger (org.jumpmind.symmetric.model.Trigger)4 Date (java.util.Date)3 Table (org.jumpmind.db.model.Table)3 IDatabasePlatform (org.jumpmind.db.platform.IDatabasePlatform)3 Data (org.jumpmind.symmetric.model.Data)3 DataGap (org.jumpmind.symmetric.model.DataGap)3 NodeChannel (org.jumpmind.symmetric.model.NodeChannel)3 INodeService (org.jumpmind.symmetric.service.INodeService)3 Test (org.junit.Test)3 DatabaseInfo (org.jumpmind.db.platform.DatabaseInfo)2