Package javax.ejb

Examples of javax.ejb.RemoveException


    try {
     
      dataAccessLayer.setSql("reports.deletereportcontent");
      dataAccessLayer.setInt(1, reportContentId);
      if (dataAccessLayer.executeUpdate() < 1) {
        throw new RemoveException("Error deleting row");
      }
    }
    finally {
      dataAccessLayer.destroy();
      dataAccessLayer = null;
View Full Code Here


    CVDal dataAccessLayer = new CVDal(primaryKey.dataSource);
    try {
      dataAccessLayer.setSql("reports.deletereport");
      dataAccessLayer.setInt(1, reportId);
      if (dataAccessLayer.executeUpdate() < 1) {
        throw new RemoveException("Error deleting report");
      }
    } finally {
      dataAccessLayer.destroy();
      dataAccessLayer = null;
    }
View Full Code Here

          // Its a time being hack.
          throw new AuthorizationFailedException("Individual - deleteIndividual");
        }
        throw new UserLoginAssociationException();
      }
      throw new RemoveException();
    }catch(RollbackException rbe){
      //TODO we shouldn't do like this Since we aren't parsing the record information.
      // Its a time being hack.
      throw new AuthorizationFailedException("Individual - deleteIndividual");
    }catch(SystemException se){
View Full Code Here

    CVDal dataAccessLayer = new CVDal(primaryKey.dataSource);
    try {
      dataAccessLayer.setSqlQuery("DELETE FROM reporttype WHERE reporttypeid = ?");
      dataAccessLayer.setInt(1, reportTypeId);
      if (dataAccessLayer.executeUpdate() < 1) {
        throw new RemoveException("Error deleting row");
      }
    }
    finally {
      dataAccessLayer.destroy();
      dataAccessLayer = null;
View Full Code Here

    private void handleRemoveMethod(final Object[] args) throws RemoteException, RemoveException {
        // check if it is an incorrect method (primary key) ?
        // args has a parameter as it uses the Home interface (so no need to
        // check the length of args)
        if (!(args[0] instanceof Handle)) {
            throw new RemoveException("The remove method is not allowed with an object which is not an handle."
                    + "Primary key is only used for entity 2.1x bean.");
        }

        // Ok, now the given arg is an Handle, get it.
        Handle handle = (Handle) args[0];
View Full Code Here

                return beanProxy;
            }
        }
        // remove method ?
        if (method != null && "remove".equals(method.getName())) {
            throw new RemoveException("Only 2.1 entity beans can use the remove(primary key) method.");
        }
        return super.invoke(proxy, method, args);
    }
View Full Code Here

   {
      // Remove file
      File file = getFile(ctx.getId());
     
      if (!file.delete()) {
         throw new RemoveException("Could not remove file: " + file);
      }
   }
View Full Code Here

   {
      // if the session is removed already then let the user know they have a problem
      StatefulSessionEnterpriseContext ctx = (StatefulSessionEnterpriseContext) mi.getEnterpriseContext();
      if (ctx.getId() == null)
      {
         throw new RemoveException("SFSB has been removed already");
      }

      // Remove from storage
      try
      {
View Full Code Here

         EnterpriseContext ctx = (EnterpriseContext) mi.getEnterpriseContext();
         if (ctx.getTransaction() == null)
            ctx.setTransaction(mi.getTransaction());
         else if(ejbObjectRemove.equals(miMethod) || ejbLocalObjectRemove.equals(miMethod))
         {
            throw new RemoveException("An attempt to remove a session " +
               "object while the object is in a transaction " +
               "(EJB2.1, 7.6.4 Restrictions for Transactions): ejb-name=" +
               metaData.getEjbName() + ", method=" + mi.getMethod() + ", tx=" + ctx.getTransaction());
         }
View Full Code Here

    */
   private void remove(Object target) throws RemoveException
   {
      // EJBTHREE-1217: EJBHome.remove(Object primaryKey) must throw RemoveException
      if(!(target instanceof Handle))
         throw new RemoveException("EJB 3 3.6.2.2: Session beans do not have a primary key");
     
      StatefulHandleRemoteImpl handle = (StatefulHandleRemoteImpl) target;

      try
      {
         handle.getEJBObject().remove();
      }
      catch(RemoteException re)
      {
         throw new RemoveException(re.getMessage());
      }
   }
View Full Code Here

TOP

Related Classes of javax.ejb.RemoveException

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.