Examples of TransactionException


Examples of org.apache.lenya.transaction.TransactionException

            source = (TransactionableSource) resolver.resolveURI(sourceUri);

            source.lock();

        } catch (Exception e) {
            throw new TransactionException(e);
        } finally {
            if (resolver != null) {
                if (source != null) {
                    resolver.release(source);
                }
View Full Code Here

Examples of org.deuce.transaction.TransactionException

            pending = true;
          }
          try{ wait(); } catch (InterruptedException e) {};
          if(schedulingList.remove(context)){
          //  Logger.info("(Schedule 1) Remotely aborting: " + context);
            throw new TransactionException();
          }
        }
        //if(!context.status.equals(STATUS.ABORTED))
        readers.add(context);
        //else throw new TransactionException();
        break;
        case WRITE_MODE:
      // Get exclusive access.
      while (writer!=null || !readers.isEmpty() || ! writeValid) {
         if(writeValid){
          if(writer!=null){
            Logger.debug("Client Side: Write Mode resolve");
            int res = HyFlow.getConflictManager().resolve(context, writer);
            if(res==0)
              writer = null;
             
          }
          if(!readers.isEmpty()){
            int res = HyFlow.getConflictManager().resolve(context, readers);
            if(res==0) readers.clear();
          }
          continue;
         }
        // Ask for object if absent.
        if (! writeValid && ! pending) {
          RetrieveRequest retrieve = new RetrieveRequest(context, key, mode);
          if (DEBUG)
            Aleph.debug(this + " sends " + retrieve + " to " + key.getHome());
          pendingContext = context;
          retrieve.send(key.getHome());
          pending = true;
        }
        try{ wait(); } catch (InterruptedException e) {};
        //Logger.info("open abortedPending "+abortedPending.size());
        if(schedulingList.remove(context)){
      //    Logger.info("(Schedule 2) Remotely aborting: " + context);
          throw new TransactionException();
        }
      }
      if(!context.status.equals(STATUS.ABORTED))
        writer = context;
      //else throw new TransactionException();
View Full Code Here

Examples of org.enhydra.shark.api.TransactionException

        if (active) {
            try {
                TransactionUtil.commit(beganTransaction);
            } catch (GenericTransactionException e) {
                Debug.logError(e, module);
                throw new TransactionException(e);
            }
            active = false;
        } else {
            Debug.logError(new Exception(), "No active transaction; unable to commit", module);
            //throw new TransactionException("No active transaction");
View Full Code Here

Examples of org.exist.storage.txn.TransactionException

     * @param loggable
     * @throws TransactionException
     */
    public synchronized void writeToLog(Loggable loggable) throws TransactionException {
        if (currentBuffer == null)
            {throw new TransactionException("Database is shut down.");}
        SanityCheck.ASSERT(!inRecovery, "Write to log during recovery. Should not happen!");
        final int size = loggable.getLogSize();
        final int required = size + LOG_ENTRY_BASE_LEN;
        if (required > currentBuffer.remaining())
            {flushToLog(false);}
        currentLsn = Lsn.create(currentFile, inFilePos + currentBuffer.position() + 1);
        loggable.setLsn(currentLsn);
        try {
            currentBuffer.put(loggable.getLogType());
            currentBuffer.putLong(loggable.getTransactionId());
            currentBuffer.putShort((short) loggable.getLogSize());
            loggable.write(currentBuffer);
            currentBuffer.putShort((short) (size + LOG_ENTRY_HEADER_LEN));
        } catch (final BufferOverflowException e) {
            throw new TransactionException("Buffer overflow while writing log record: " + loggable.dump(), e);
        }
        pool.getTransactionManager().trackOperation(loggable.getTransactionId());
    }
View Full Code Here

Examples of org.exoplatform.services.transaction.TransactionException

            transactionLog = null;
            storageDataManager.save(tl);
         }
         catch (InvalidItemStateException e)
         {
            throw new TransactionException(e.getMessage(), e);
         }
         catch (RepositoryException e)
         {
            throw new TransactionException(e.getMessage(), e);
         }
      }
   }
View Full Code Here

Examples of org.exoplatform.services.transaction.TransactionException

            transactionLog = null;
            storageDataManager.save(tl);
         }
         catch (InvalidItemStateException e)
         {
            throw new TransactionException(e.getMessage(), e);
         }
         catch (RepositoryException e)
         {
            throw new TransactionException(e.getMessage(), e);
         }
      }
   }
View Full Code Here

Examples of org.g4studio.core.orm.xibatis.sqlmap.engine.transaction.TransactionException

  public JtaTransaction(UserTransaction utx, DataSource ds, int isolationLevel) throws TransactionException {
    // Check parameters
    userTransaction = utx;
    dataSource = ds;
    if (userTransaction == null) {
      throw new TransactionException("JtaTransaction initialization failed.  UserTransaction was null.");
    }
    if (dataSource == null) {
      throw new TransactionException("JtaTransaction initialization failed.  DataSource was null.");
    }
    this.isolationLevel.setIsolationLevel(isolationLevel);
  }
View Full Code Here

Examples of org.hibernate.TransactionException

      final JtaPlatform jtaPlatform = transactionCoordinator
          .getTransactionContext()
          .getTransactionEnvironment()
          .getJtaPlatform();
      if ( jtaPlatform == null ) {
        throw new TransactionException( "Unable to check transaction status" );
      }
      if ( jtaPlatform.retrieveTransactionManager() != null ) {
        return JtaStatusHelper.isActive( jtaPlatform.retrieveTransactionManager().getStatus() );
      }
      else {
        final UserTransaction ut = jtaPlatform.retrieveUserTransaction();
        return ut != null && JtaStatusHelper.isActive( ut );
      }
    }
    catch ( SystemException se ) {
      throw new TransactionException( "Unable to check transaction status", se );
    }
  }
View Full Code Here

Examples of org.hibernate.TransactionException

      }
      catch( HibernateException e ) {
        throw e;
      }
      catch (Exception e) {
        throw new TransactionException( "could not register synchronization with JTA TransactionManager", e );
      }
    }
  }
View Full Code Here

Examples of org.hibernate.TransactionException

  private void setTimeout(PreparedStatement result) throws SQLException {
    if ( isTransactionTimeoutSet ) {
      int timeout = (int) ( transactionTimeout - ( System.currentTimeMillis() / 1000 ) );
      if (timeout<=0) {
        throw new TransactionException("transaction timeout expired");
      }
      else {
        result.setQueryTimeout(timeout);
      }
    }
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.