Examples of NucleusTransactionException


Examples of org.datanucleus.transaction.NucleusTransactionException

            if (ex instanceof NucleusException)
            {
                throw (NucleusException)ex;
            }
            // Wrap all other exceptions in a NucleusTransactionException
            throw new NucleusTransactionException(LOCALISER.msg("015005"), ex);
        }
    }
View Full Code Here

Examples of org.datanucleus.transaction.NucleusTransactionException

                }
            }
        }
        if (errors.size() > 0)
        {
            throw new NucleusTransactionException(LOCALISER.msg("015007"), (Throwable[])errors.toArray(
                new Throwable[errors.size()]));
        }

        if (NucleusLogger.TRANSACTION.isDebugEnabled())
        {
View Full Code Here

Examples of org.datanucleus.transaction.NucleusTransactionException

            // See http://www.onjava.com/pub/a/onjava/2005/07/20/transactions.html
            jtaTxManager = new TransactionManagerFinder(this).getTransactionManager(
                getClassLoaderResolver((ClassLoader)config.getProperty("datanucleus.primaryClassLoader")));
            if (jtaTxManager == null)
            {
                throw new NucleusTransactionException(LOCALISER.msg("015030"));
            }
        }
        return jtaTxManager;
    }
View Full Code Here

Examples of org.datanucleus.transaction.NucleusTransactionException

                    }
                }
            }
            catch (SystemException e)
            {
                throw new NucleusTransactionException(LOCALISER.msg("015026"), e);
            }
        }
    }
View Full Code Here

Examples of org.datanucleus.transaction.NucleusTransactionException

            }
        }
        catch (Exception e)
        {
            e.printStackTrace();
            throw new NucleusTransactionException("Cannot register Synchronization to a valid JTA Transaction");
        }
    }
View Full Code Here

Examples of org.datanucleus.transaction.NucleusTransactionException

    public void begin()
    {
        checkTransactionJoin();
        if (joinStatus != JoinStatus.NO_TXN)
        {
            throw new NucleusTransactionException("JTA Transaction is already active");
        }

        UserTransaction utx;
        try
        {
            utx = getUserTransaction();
        }
        catch (NamingException e)
        {
            throw om.getApiAdapter().getExceptionForException("Failed to obtain UserTransaction", e);
        }

        try
        {
            utx.begin();
        }
        catch (NotSupportedException e)
        {
            throw om.getApiAdapter().getExceptionForException("Failed to begin UserTransaction", e);
        }
        catch (SystemException e)
        {
            throw om.getApiAdapter().getExceptionForException("Failed to begin UserTransaction", e);
        }

        checkTransactionJoin();
        if (joinStatus != JoinStatus.JOINED)
        {
            throw new NucleusTransactionException("Cannot join an auto started UserTransaction");
        }
        userTransaction = utx;
    }
View Full Code Here

Examples of org.datanucleus.transaction.NucleusTransactionException

     */
    public void commit()
    {
        if (userTransaction == null)
        {
            throw new NucleusTransactionException("No internal UserTransaction");
        }

        try
        {
            userTransaction.commit();
View Full Code Here

Examples of org.datanucleus.transaction.NucleusTransactionException

     */
    public void rollback()
    {
        if (userTransaction == null)
        {
            throw new NucleusTransactionException("No internal UserTransaction");
        }

        try
        {
            userTransaction.rollback();
View Full Code Here

Examples of org.datanucleus.transaction.NucleusTransactionException

     */
    public void setRollbackOnly()
    {
        if (userTransaction == null)
        {
            throw new NucleusTransactionException("No internal UserTransaction");
        }

        try
        {
            userTransaction.setRollbackOnly();
View Full Code Here

Examples of org.datanucleus.transaction.NucleusTransactionException

    private TransactionManager obtainTransactionManager()
    {
        TransactionManager tm = om.getOMFContext().getJtaTransactionManager();
        if (tm == null)
        {
            throw new NucleusTransactionException(LOCALISER.msg("015030"));
        }
        else
        {
            return tm;
        }
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.