Package com.atomikos.icatch

Examples of com.atomikos.icatch.SysException


                startlistening ( coord );
            }
        } catch ( Exception e ) {
            LOGGER.logWarning ( "Error in recoverCoordinators", e );
            errors.push ( e );
            throw new SysException ( "Error in recoverCoordinators: "
                    + e.getMessage (), errors );
        }

    }
View Full Code Here


                LOGGER.logWarning ( "Error in recover: "
                        + e.getClass ().getName () + e.getMessage (), e );

                Stack errors = new Stack ();
                errors.push ( e );
                throw new SysException ( "Error in recovering: "
                        + e.getMessage (), errors );
            }

        }
View Full Code Here

        try {
            recoverymanager_.init (properties);
        } catch ( LogException le ) {
            errors.push ( le );
            throw new SysException ( "Error in init: " + le.getMessage (),
                    errors );
        }
        recoverCoordinators ();

        shutdownInProgress_ = false;
View Full Code Here

        try {
            String tid = tidmgr_.get ();
            boolean serial = context.isSerial ();
            Stack lineage = context.getLineage ();
            if ( lineage.empty () )
                throw new SysException (
                        "Empty lineage in propagation: empty lineage" );
            Stack tmp = new Stack ();

            while ( !lineage.empty () ) {
                tmp.push ( lineage.pop () );
            }

            CompositeTransaction root = (CompositeTransaction) tmp.peek ();

            while ( !tmp.empty () ) {
                lineage.push ( tmp.pop () );
            }

            CompositeTransaction parent = (CompositeTransaction) lineage
                    .peek ();
            synchronized ( shutdownSynchronizer_ ) {
                synchronized ( getLatch ( root.getTid () ) ) {
                    cc = getCoordinatorImp ( root.getTid () );
                    if ( cc == null ) {
                        RecoveryCoordinator coord = parent
                                .getCompositeCoordinator ()
                                .getRecoveryCoordinator ();
                        cc = createCC ( coord, root.getTid (), orphancheck,
                                heur_commit, context.getTimeOut () );
                    }
                    cc.incLocalSiblingCount (); // for detection of orphans
                }
            }
            ct = createCT ( tid, cc, lineage, serial );

        } catch ( Exception e ) {
            errors.push ( e );
            e.printStackTrace ();
            throw new SysException ( "Error in recreate.", errors );
        }

        return ct;
    }
View Full Code Here

                } catch ( InterruptedException inter ) {
                  // cf bug 67457
              InterruptedExceptionHelper.handleInterruptedException ( inter );
                    errors.push ( inter );
                    throw new SysException ( "Error in shutdown: "
                            + inter.getMessage (), errors );
                }
            }
            notifyListeners ( false, true );
            initialized_ = false;
            if ( !wasShuttingDown ) {
                // If we were already shutting down, then the FIRST thread
                // to enter this method will do the following. Don't do
                // it twice.
                try {
                    recoverymanager_.close ();
                } catch ( LogException le ) {
                    errors.push ( le );
                    le.printStackTrace();
                    throw new SysException ( "Error in shutdown: "
                            + le.getMessage (), errors );
                }
             
            }
View Full Code Here

         try {
             ct_.getCoordinatorImp().rollback();
         } catch ( HeurCommitException e ) {
             errors.push ( e );
             throw new SysException ( "Unexpected error in rollback", errors );
         } catch ( HeurMixedException e ) {
             errors.push ( e );
             throw new SysException ( "Unexpected error in rollback", errors );
         } catch ( HeurHazardException e ) {
             errors.push ( e );
             throw new SysException ( "Unexpected error in rollback", errors );
         }
    }
View Full Code Here

        msg = tag;
        try {
            propagation = Configuration.getExportingTransactionManager ()
                    .getPropagation ();
        } catch ( RollbackException e ) {
            throw new SysException ( "Transaction already rolled back" );
        }
        myWaiter = w;
        myWaiter.incActives ();
        myCode = code;
        myException = null;
View Full Code Here

                    // this is impossible since it assumes that ALL
                    // participants voted YES in the first place,
                    // which contradicts the fact that we are dealing with
                    // !voteOK
                    errors.push ( hc );
                    throw new SysException ( "Unexpected heuristic: "
                            + hc.getMessage (), errors );
                }
                throw new RollbackException ( "Prepare: " + "NO vote" );
            
            }
        } catch ( RuntimeException runerr ) {
            errors.push ( runerr );
            throw new SysException ( "Error in prepare: " + runerr.getMessage (), errors );
        } catch ( InterruptedException err ) {
          // cf bug 67457
      InterruptedExceptionHelper.handleInterruptedException ( err );
            errors.push ( err );
            throw new SysException ( "Error in prepare: " + err.getMessage (), errors );
        }
        // here we are if all yes.
        if ( allReadOnly ) {
            nextStateHandler = new TerminatedStateHandler ( this );
            getCoordinator ().setStateHandler ( nextStateHandler );
View Full Code Here

        } catch ( RollbackException rb ) {
            // impossible since this happens for 1PC only,
            // and 1PC txs are not in the log?!
            Stack<Exception> errors = new Stack<Exception> ();
            errors.push ( rb );
            throw new SysException ( "Error in forced commit: " + rb.getMessage (), errors );
        }
    }
View Full Code Here

        if ( delegate_ != null ) return;

        String factoryClassName = getOrFindProperty ( "com.atomikos.icatch.service" );

        if ( factoryClassName == null )
            throw new SysException (
            "UserTransactionServiceImp: property not defined: com.atomikos.icatch.service" );

        try {
            Class factoryClass = ClassLoadingHelper.loadClass ( factoryClassName );
            UserTransactionServiceFactory factory =
                    ( UserTransactionServiceFactory ) factoryClass.newInstance ();
            delegate_ = factory.getUserTransactionService ( properties_ );
            //This should initialize the properties with whatever is specified and
            //use SYSTEM_DEPENDENT DEFAULT values for others
        }
        catch ( Exception e ) {
            Stack errors = new Stack ();
            errors.push ( e );
            throw new SysException ( "Error in init of UserTransactionServiceImp: " + e.getMessage() , errors );
        }

    }
View Full Code Here

TOP

Related Classes of com.atomikos.icatch.SysException

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.