Package com.atomikos.icatch

Examples of com.atomikos.icatch.SysException


       
        try {
            recoverymanager_.init ();
        } catch ( LogException le ) {
            errors.push ( le );
            throw new SysException ( "Error in init: " + le.getMessage (),
                    errors );
        }
        recoverCoordinators ();
       
        //initialized is now set in recover()
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 ( shutdownWaiter_ ) {
                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 );
                }
            }
            // System.err.println ( "Transaction Service: Check Done." );
            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 {
                    // System.err.println ( "Transaction Service: Closing
                    // logs..." );
                    recoverymanager_.close ();
                    // System.err.println ( "Transaction Service: Logs Closed."
                    // );
                } catch ( LogException le ) {
                    errors.push ( le );
                    le.printStackTrace();
                    throw new SysException ( "Error in shutdown: "
                            + le.getMessage (), errors );
                }
                // recoverymanager_ = null;
                // removed because repeated start/shutdown will fail cause of
                // this.
View Full Code Here

        }

        catch ( RuntimeException runerr ) {
            errors.push ( runerr );
            throw new SysException ( "Error in rollback: "
                    + runerr.getMessage (), errors );
        }

        catch ( InterruptedException e ) {
          // cf bug 67457
      InterruptedExceptionHelper.handleInterruptedException ( e );
            errors.push ( e );
            throw new SysException ( "Error in rollback: " + e.getMessage (),
                    errors );
        } finally {
            // System.err.println ( "Exiting CoordinatorStateHandler.rollback"
            // );
        }
View Full Code Here

                throw hm;
            } catch ( SysException se ) {
                throw se;
            } catch ( Exception e ) {
                errors.push ( e );
                throw new SysException (
                        "Unexpected error: " + e.getMessage (), errors );
            }
        }

    }
View Full Code Here

        if ( transaction_.isRoot () )
            try {
                coordinator_.terminate ( false );
            } catch ( Exception e ) {
                errors.push ( e );
                throw new SysException ( "Unexpected error in rollback: "
                        + e.getMessage (), 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" );

                // } //else
            } // if (!voteOK)
        } 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 );
View Full Code Here

                coordinator_.setStateHandler ( nextStateHandler );
            }
        } catch ( RuntimeException runerr ) {
            errors.push ( runerr );
            throw new SysException (
                    "Error in commit: " + runerr.getMessage (), errors );
        }

        catch ( InterruptedException intr ) {
          // cf bug 67457
      InterruptedExceptionHelper.handleInterruptedException ( intr );
            errors.push ( intr );
            throw new SysException ( "Error in commit" + intr.getMessage (),
                    errors );
        }

        return getHeuristicMessages ();
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<Exception> errors = new Stack<Exception> ();
            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.