Package javax.persistence

Examples of javax.persistence.PersistenceException


      try {
        BeanFinder<?> beanFinder = (BeanFinder<?>) cls.newInstance();       
        registerFor.put(entityType, beanFinder);
       
      } catch (Exception ex) {
        throw new PersistenceException(ex);
      }
    }
   
    return registerFor.size();
  }
View Full Code Here


     
    Class<?> cls = ParamTypeUtil.findParamType(controller, BeanFinder.class);
   
    if (cls == null){
      String msg = "Could not determine the entity class (generics parameter type) from "+controller+" using reflection.";
      throw new PersistenceException(msg);
    }
    return cls;
    }
View Full Code Here

      return OnQueryOnly.COMMIT;
    }
    if (onQueryOnly.startsWith("CLOSE")){
      if (!isReadCommitedIsolation(ds)){
        String m = "transaction.queryonlyclose is true but the transaction Isolation Level is not READ_COMMITTED";
        throw new PersistenceException(m);
      } else {
        return OnQueryOnly.CLOSE_ON_READCOMMITTED;       
      }
    }
    // default to rollback
View Full Code Here

      int isolationLevel = c.getTransactionIsolation();
      return (isolationLevel == Connection.TRANSACTION_READ_COMMITTED);

    } catch (SQLException ex) {
      String m = "Errored trying to determine the default Isolation Level";
      throw new PersistenceException(m, ex);     

    } finally {
      try {
        if (c != null) {
          c.close();
View Full Code Here

          c.close();
        }
      } catch (SQLException e) {
        logger.error("Error closing failed connection", e);
      }
      throw new PersistenceException(ex);
    }
  }
View Full Code Here

      }
      throw ex;
     
    } catch (SQLException ex) {
      // don't need to close connection in this case
      throw new PersistenceException(ex);
    }
  }
View Full Code Here

        colLabel = colInfo.substring(lastSpace + 1);
      } else {
        String msg = "Error in " + parent.getErrName() + ". ";
        msg += "Expected \"AS\" keyword but got [" + expectedAs + "] in select clause ["
            + colInfo + "]";
        throw new PersistenceException(msg);
      }
    }

   
    BeanProperty prop = findProperty(colLabel);
View Full Code Here

  public void backgroundFetchWait(long wait, TimeUnit timeUnit) {
    if (fetchFuture != null){
      try {
        fetchFuture.get(wait, timeUnit);
      } catch (Exception e) {
        throw new PersistenceException(e);
      }    
    }
  }
View Full Code Here

  public void backgroundFetchWait() {
    if (fetchFuture != null){
      try {
        fetchFuture.get();
      } catch (Exception e) {
        throw new PersistenceException(e);
      }    
    }
  }
View Full Code Here

         */
        public void set(SpiTransaction trans) {
           
          if (transaction != null && transaction.isActive()){
            String m = "The existing transaction is still active?";
                throw new PersistenceException(m);
            }
            transaction = trans;
        }
View Full Code Here

TOP

Related Classes of javax.persistence.PersistenceException

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.