Package org.springframework.transaction.support

Examples of org.springframework.transaction.support.TransactionCallbackWithoutResult


    final List l = new ArrayList();
    l.add("test");
    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());

    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
        JcrTemplate template = new JcrTemplate(sf);
        template.save();
      }
View Full Code Here


    l.add("test");
    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());

    try {
      tt.execute(new TransactionCallbackWithoutResult() {
        protected void doInTransactionWithoutResult(TransactionStatus status) {
          assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
          JcrTemplate template = new JcrTemplate(sf);
          template.execute(new JcrCallback() {
            public Object doInJcr(Session se) throws RepositoryException {
View Full Code Here

    final List l = new ArrayList();
    l.add("test");
    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());

    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
        JcrTemplate template = new JcrTemplate(sf);
        template.execute(new JcrCallback() {
          public Object doInJcr(Session se) throws RepositoryException {
View Full Code Here

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());

    tt.setIsolationLevel(TransactionDefinition.ISOLATION_SERIALIZABLE);
    try {
      tt.execute(new TransactionCallbackWithoutResult() {
        protected void doInTransactionWithoutResult(TransactionStatus status) {
          assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
          JcrTemplate template = new JcrTemplate(sf);
          template.execute(new JcrCallback() {
            public Object doInJcr(Session session) throws RepositoryException {
View Full Code Here

    UserTxSessionHolder uTx = new UserTxSessionHolder(session);
    TransactionSynchronizationManager.bindResource(sf, uTx);

    assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));

    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
        JcrTemplate template = new JcrTemplate(sf);
        template.save();
      }
View Full Code Here

    assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
    uTx.setRollbackOnly();

    try {
      tt.execute(new TransactionCallbackWithoutResult() {
        protected void doInTransactionWithoutResult(TransactionStatus status) {
          assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
          JcrTemplate template = new JcrTemplate(sf);
          template.save();
        }
View Full Code Here

    public void deleteScheduledEvent(final int scheduledEventId) {
        ScheduledEventVO se = getScheduledEvent(scheduledEventId);
        final ExtendedJdbcTemplate ejt2 = ejt;
        if (se != null) {
            getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
                @Override
                protected void doInTransactionWithoutResult(TransactionStatus status) {
                    ejt2.update("delete from eventHandlers where eventTypeName=? and eventTypeRef1=?", new Object[] {
                            ScheduledEventType.TYPE_NAME, scheduledEventId });
                    ejt2.update("delete from scheduledEvents where id=?", new Object[] { scheduledEventId });
View Full Code Here

        return watchList;
    }

    public void saveWatchList(final WatchList watchList) {
        final ExtendedJdbcTemplate ejt2 = ejt;
        getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
            @SuppressWarnings("synthetic-access")
            @Override
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                if (watchList.getId() == Common.NEW_ID)
                    watchList.setId(doInsert("insert into watchLists (xid, name, userId) values (?,?,?)", new Object[] {
View Full Code Here

        });
    }

    public void deleteWatchList(final int watchListId) {
        final ExtendedJdbcTemplate ejt2 = ejt;
        getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
            @Override
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                ejt2.update("delete from watchListPoints where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from watchListUsers where watchListId=?", new Object[] { watchListId });
                ejt2.update("delete from selectedWatchList where watchListId=?", new Object[] { watchListId });
View Full Code Here

    public void deleteMaintenanceEvent(final int maintenanceEventId) {
        MaintenanceEventVO me = getMaintenanceEvent(maintenanceEventId);
        final ExtendedJdbcTemplate ejt2 = ejt;
        if (me != null) {
            getTransactionTemplate().execute(new TransactionCallbackWithoutResult() {
                @Override
                protected void doInTransactionWithoutResult(TransactionStatus status) {
                    ejt2.update("delete from eventHandlers where eventTypeName=? and eventTypeRef1=?", new Object[] {
                            MaintenanceEventType.TYPE_NAME, maintenanceEventId });
                    ejt2.update("delete from maintenanceEvents where id=?", new Object[] { maintenanceEventId });
View Full Code Here

TOP

Related Classes of org.springframework.transaction.support.TransactionCallbackWithoutResult

Copyright © 2018 www.massapicom. 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.