Package org.modeshape.jcr.txn.Transactions

Examples of org.modeshape.jcr.txn.Transactions.Transaction.rollback()


            try {
                V result = operation.call();
                txn.commit();
                return result;
            } catch (Exception e) {
                txn.rollback();
                throw (e instanceof RuntimeException) ? (RuntimeException)e : new RuntimeException(e);
            }
        } catch (IllegalStateException | SystemException err) {
            throw new SystemFailureException(err);
        } catch (NotSupportedException e) {
View Full Code Here


                    clearState();

                } catch (org.infinispan.util.concurrent.TimeoutException e) {
                    if (txn != null) {
                        txn.rollback();
                    }
                    if (repeat <= 0) {
                        throw new TimeoutException(e.getMessage(), e);
                    }
                    Thread.sleep(PAUSE_TIME_BEFORE_REPEAT_FOR_LOCK_ACQUISITION_TIMEOUT);
View Full Code Here

                    // System failed unexpectedly ...
                    throw new SystemFailureException(err);
                } catch (Throwable t) {
                    // any other exception/error we should rollback
                    if (txn != null) {
                        txn.rollback();
                    }
                    // let the exception bubble up
                    throw t;
                }
View Full Code Here

                        events2 = that.persistChanges(that.changedNodesInOrder, thatPersistedCache);
                        if (events2.hasBinaryChanges()) {
                            txn.uponCommit(binaryUsageUpdateFunction(events2.usedBinaries(), events2.unusedBinaries()));
                        }
                    } catch (org.infinispan.util.concurrent.TimeoutException e) {
                        txn.rollback();
                        if (repeat <= 0) throw new TimeoutException(e.getMessage(), e);
                        --repeat;
                        Thread.sleep(PAUSE_TIME_BEFORE_REPEAT_FOR_LOCK_ACQUISITION_TIMEOUT);
                        continue;
                    } catch (IllegalStateException err) {
View Full Code Here

                        // Not associated with a txn??
                        throw new SystemFailureException(err);
                    } catch (Exception e) {
                        LOGGER.debug(e, "Error while attempting to save");
                        // Some error occurred (likely within our code) ...
                        txn.rollback();
                        throw e;
                    }

                    LOGGER.debug("Altered {0} node(s)", numNodes);
View Full Code Here

                        events2 = that.persistChanges(that.changedNodesInOrder, thatPersistedCache);
                        if (events2.hasBinaryChanges()) {
                            txn.uponCommit(binaryUsageUpdateFunction(events2.usedBinaries(), events2.unusedBinaries()));
                        }
                    } catch (org.infinispan.util.concurrent.TimeoutException e) {
                        txn.rollback();
                        if (repeat <= 0) throw new TimeoutException(e.getMessage(), e);
                        --repeat;
                        Thread.sleep(PAUSE_TIME_BEFORE_REPEAT_FOR_LOCK_ACQUISITION_TIMEOUT);
                        continue;
                    } catch (IllegalStateException err) {
View Full Code Here

                    } catch (IllegalArgumentException err) {
                        // Not associated with a txn??
                        throw new SystemFailureException(err);
                    } catch (Exception e) {
                        // Some error occurred (likely within our code) ...
                        txn.rollback();
                        throw e;
                    }

                    LOGGER.debug("Altered {0} node(s)", numNodes);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.