Package javax.jdo

Examples of javax.jdo.JDOOptimisticVerificationException


                for (int i=0;i<nested.length;i++)
                {
                    jdoNested[i] =
                        (JDOOptimisticVerificationException)JPOXJDOHelper.getJDOExceptionForJPOXException((JPOXException)nested[i]);
                }
                throw new JDOOptimisticVerificationException(jpe.getMessage(), jdoNested);
            }
            else
            {
                // Convert any JPOX exceptions into what JDO expects
                throw JPOXJDOHelper.getJDOExceptionForJPOXException(jpe);
View Full Code Here


                            nestedEx = new JPOXException(nested[i].getMessage(),nested[i]);                       
                        }
                        jdoNested[i] =
                            (JDOOptimisticVerificationException)JPOXJDOHelper.getJDOExceptionForJPOXException(nestedEx);
                    }
                    throw new JDOOptimisticVerificationException(jpe.getMessage(), jdoNested);
                }
                else
                {
                    JPOXException ex;
                    if (jpe.getNestedExceptions()[0] instanceof JPOXException)
View Full Code Here

        else if (jpe instanceof JPOXOptimisticException)
        {
            //sadly JDOOptimisticVerificationException dont allow nested exceptions and failed objects together
            if (jpe.getFailedObject() != null)
            {
                return new JDOOptimisticVerificationException(jpe.getMessage(), jpe.getFailedObject());
            }
            else if (jpe.getNestedExceptions() != null)
            {
                return new JDOOptimisticVerificationException(jpe.getMessage(), jpe.getNestedExceptions());
            }
            else
            {
                return new JDOOptimisticVerificationException(jpe.getMessage(), jpe);
            }
        }
        else if (jpe instanceof org.jpox.transaction.HeuristicRollbackException
                && jpe.getNestedExceptions().length==1
                && jpe.getNestedExceptions()[0].getCause() instanceof SQLException)
View Full Code Here

        else if (ne instanceof NucleusOptimisticException)
        {
            //sadly JDOOptimisticVerificationException dont allow nested exceptions and failed objects together
            if (ne.getFailedObject() != null)
            {
                return new JDOOptimisticVerificationException(ne.getMessage(), ne.getFailedObject());
            }
            else if (ne.getNestedExceptions() != null)
            {
                return new JDOOptimisticVerificationException(ne.getMessage(), ne.getNestedExceptions());
            }
            else
            {
                return new JDOOptimisticVerificationException(ne.getMessage(), ne);
            }
        }
        else if (ne instanceof org.datanucleus.transaction.HeuristicRollbackException
                && ne.getNestedExceptions().length==1
                && ne.getNestedExceptions()[0].getCause() instanceof SQLException)
View Full Code Here

                        for (int i=0;i<numNested;i++)
                        {
                            NucleusException nested = (NucleusOptimisticException)ne.getNestedExceptions()[i];
                            jdoNested[i] = (JDOOptimisticVerificationException) NucleusJDOHelper.getJDOExceptionForNucleusException(nested);
                        }
                        throw new JDOOptimisticVerificationException(ne.getMessage(), jdoNested);
                    }
                    else
                    {
                        // Exception with nested wrapper optimistic exception, with subnested optimistic exception(s)
                        NucleusException ex;
                        if (ne.getNestedExceptions()[0] instanceof NucleusException)
                        {
                            ex = (NucleusException)ne.getNestedExceptions()[0];
                        }
                        else
                        {
                            ex = new NucleusException(ne.getNestedExceptions()[0].getMessage(),ne.getNestedExceptions()[0]);                       
                        }

                        // Optimistic exceptions - return a single JDOOptimisticVerificationException
                        // with all individual exceptions nested
                        Throwable[] nested = ex.getNestedExceptions();
                        JDOOptimisticVerificationException[] jdoNested = new JDOOptimisticVerificationException[nested.length];
                        for (int i=0;i<nested.length;i++)
                        {
                            NucleusException nestedEx;
                            if (nested[i] instanceof NucleusException)
                            {
                                nestedEx = (NucleusException)nested[i];
                            }
                            else
                            {
                                nestedEx = new NucleusException(nested[i].getMessage(),nested[i]);                       
                            }
                            jdoNested[i] =
                                (JDOOptimisticVerificationException)NucleusJDOHelper.getJDOExceptionForNucleusException(nestedEx);
                        }
                        throw new JDOOptimisticVerificationException(ne.getMessage(), jdoNested);
                    }
                }
                else
                {
                    NucleusException ex;
View Full Code Here

    }

    try {
      createTemplate().execute(new JdoCallback() {
        public Object doInJdo(PersistenceManager pm) {
          throw new JDOOptimisticVerificationException();
        }
      });
      fail("Should have thrown JdoOptimisticLockingFailureException");
    }
    catch (JdoOptimisticLockingFailureException ex) {
View Full Code Here

                for (int i=0;i<nested.length;i++)
                {
                    jdoNested[i] =
                        (JDOOptimisticVerificationException)NucleusJDOHelper.getJDOExceptionForNucleusException((NucleusException)nested[i]);
                }
                throw new JDOOptimisticVerificationException(jpe.getMessage(), jdoNested);
            }
            else
            {
                // Convert any DataNucleus exceptions into what JDO expects
                throw NucleusJDOHelper.getJDOExceptionForNucleusException(jpe);
View Full Code Here

                            nestedEx = new NucleusException(nested[i].getMessage(),nested[i]);                       
                        }
                        jdoNested[i] =
                            (JDOOptimisticVerificationException)NucleusJDOHelper.getJDOExceptionForNucleusException(nestedEx);
                    }
                    throw new JDOOptimisticVerificationException(jpe.getMessage(), jdoNested);
                }
                else
                {
                    NucleusException ex;
                    if (jpe.getNestedExceptions()[0] instanceof NucleusException)
View Full Code Here

        else if (jpe instanceof NucleusOptimisticException)
        {
            //sadly JDOOptimisticVerificationException dont allow nested exceptions and failed objects together
            if (jpe.getFailedObject() != null)
            {
                return new JDOOptimisticVerificationException(jpe.getMessage(), jpe.getFailedObject());
            }
            else if (jpe.getNestedExceptions() != null)
            {
                return new JDOOptimisticVerificationException(jpe.getMessage(), jpe.getNestedExceptions());
            }
            else
            {
                return new JDOOptimisticVerificationException(jpe.getMessage(), jpe);
            }
        }
        else if (jpe instanceof org.datanucleus.transaction.HeuristicRollbackException
                && jpe.getNestedExceptions().length==1
                && jpe.getNestedExceptions()[0].getCause() instanceof SQLException)
View Full Code Here

TOP

Related Classes of javax.jdo.JDOOptimisticVerificationException

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.