Examples of JDODataStoreException


Examples of javax.jdo.JDODataStoreException

    }
    public void flush() {
        try {
          speedoFlush();
        } catch (PersistenceException e) {
            throw new JDODataStoreException("Impossible to flush the working set");
        }
    }
View Full Code Here

Examples of javax.jdo.JDODataStoreException

                    logger.log(BasicLevel.WARN, "Error during unbinding:", e1);
                }
                if (e instanceof RolledBackPersistenceException) {
                    throw ((JDOTransactionItf) tx).rollBackOnInternalError(e);
                } else {
                    throw new JDODataStoreException(
                        "Problem while making persistent.",
                        new Exception[]{ExceptionHelper.getNested(e)});
                }
            }
        }
View Full Code Here

Examples of javax.jdo.JDODataStoreException

        if(!sa.hasBeenFlush()){
          //flush
          tpm.flush(tx, sa);
        }
      } catch (Exception e) {
        throw new JDODataStoreException(
        "Problem while flushing a persistent object in order to detach a copy.",
        new Exception[]{ExceptionHelper.getNested(e)});
      }
    }
    //the core processing
View Full Code Here

Examples of javax.jdo.JDODataStoreException

    }

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

Examples of javax.jdo.JDODataStoreException

    private void assertNotRollbackOnly()
    {
        if (rollbackOnlyFlag)
        {
            throw new JDODataStoreException("Rollback Only !");
        }
    }
View Full Code Here

Examples of javax.jdo.JDODataStoreException

            {
                if (jpe.getNestedExceptions() != null)
                {
                    if (jpe.getFailedObject() != null)
                    {
                        return new JDODataStoreException(jpe.getMessage(), jpe.getNestedExceptions(), jpe.getFailedObject());
                    }
                    return new JDODataStoreException(jpe.getMessage(), jpe.getNestedExceptions());
                }
                else if (jpe.getFailedObject() != null)
                {
                    NucleusLogger.JDO.info("Exception thrown", jpe);
                    return new JDODataStoreException(jpe.getMessage(), jpe.getFailedObject());
                }
                else
                {
                    NucleusLogger.JDO.info("Exception thrown", jpe);
                    return new JDODataStoreException(jpe.getMessage(), jpe);
                }
            }
        }
        else if (jpe instanceof NucleusObjectNotFoundException)
        {           
            //sadly JDOObjectNotFoundException dont allow nested exceptions and failed objects together
            if (jpe.getFailedObject() != null)
            {
                return new JDOObjectNotFoundException(jpe.getMessage(), jpe.getFailedObject());
            }
            else if (jpe.getNestedExceptions() != null)
            {
                return new JDOObjectNotFoundException(jpe.getMessage(), jpe.getNestedExceptions());
            }
            else
            {
                return new JDOObjectNotFoundException(jpe.getMessage(), new Throwable[]{jpe});
            }
        }
        else if (jpe instanceof NucleusUserException)
        {
            if (jpe.isFatal())
            {
                if (jpe.getNestedExceptions() != null)
                {
                    if (jpe.getFailedObject() != null)
                    {
                        return new JDOFatalUserException(jpe.getMessage(), jpe.getNestedExceptions(), jpe.getFailedObject());
                    }
                    return new JDOFatalUserException(jpe.getMessage(), jpe.getNestedExceptions());
                }
                else if (jpe.getFailedObject() != null)
                {
                    NucleusLogger.JDO.info("Exception thrown", jpe);
                    return new JDOFatalUserException(jpe.getMessage(), jpe.getFailedObject());
                }
                else
                {
                    NucleusLogger.JDO.info("Exception thrown", jpe);
                    return new JDOFatalUserException(jpe.getMessage(), jpe);
                }
            }
            else
            {
                if (jpe.getNestedExceptions() != null)
                {
                    if (jpe.getFailedObject() != null)
                    {
                        return new JDOUserException(jpe.getMessage(), jpe.getNestedExceptions(), jpe.getFailedObject());
                    }
                    return new JDOUserException(jpe.getMessage(), jpe.getNestedExceptions());
                }
                else if (jpe.getFailedObject() != null)
                {
                    NucleusLogger.JDO.info("Exception thrown", jpe);
                    return new JDOUserException(jpe.getMessage(), jpe.getFailedObject());
                }
                else
                {
                    NucleusLogger.JDO.info("Exception thrown", jpe);
                    return new JDOUserException(jpe.getMessage(), jpe);
                }
            }
        }
        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)
        {
            // if there was a single failure in the transaction, we want to properly propagate the
            // single nested SQLException that was the cause of the failure, so application code
            // can decide on what to do with it
            return new JDODataStoreException(jpe.getMessage(), ((XAException)jpe.getNestedExceptions()[0]).getCause());
        }
        else
        {
            if (jpe.isFatal())
            {
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.