Remove methods in Entity EJBs

Hi,
I have a entity EJB with following methods:
findByPrimaryKey(PK)
create(PK)
get and set methods
I wanna add a remove method which will take the PK and delete the record for
me.
Please tell me the changes I have to incorporate. and How do i do it. I am using VA 3.5 and WAS 3.5
Thanx & Regards
Ravi Mittal

hi,
after adding access bean & generating deployed code you have to add remove method in Access Bean by yourself. remove(object) is in EJBhome interface.
you have to pass object of key class. so add empty remove() in acees bean. instantiate ur key class there & call remove(keclassobject) method. I think it will help you.
-priya

Similar Messages

  • Exception when invoking create method on entity ejb's home object

    I have a simple entity bean. I am able to get the reference to the entity's home object. But when I run create method on entity's home interface, I get the following exception. The create method takes no arguments as the primary key is Auto-Increment field in MYSQL database. Here is the exception. I am using jdeveloper and embedded OC4J as server.
    07/06/22 15:51:15 java.lang.NullPointerException
    07/06/22 15:51:15 at EmployeeHome_EntityHomeWrapper2.create(EmployeeHome_EntityHomeWrapper2.java:1168)
    07/06/22 15:51:15 at com.pd.EmpAddInput.addEmployee(EmpAddInput.java:64)
    07/06/22 15:51:15 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    07/06/22 15:51:15 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    07/06/22 15:51:15 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    07/06/22 15:51:15 at java.lang.reflect.Method.invoke(Method.java:585)
    07/06/22 15:51:15 at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
    07/06/22 15:51:15 at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
    07/06/22 15:51:15 at javax.faces.component.UICommand.broadcast(UICommand.java:332)
    07/06/22 15:51:15 at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
    07/06/22 15:51:15 at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
    07/06/22 15:51:15 at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
    07/06/22 15:51:15 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:268)
    07/06/22 15:51:15 at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
    07/06/22 15:51:15 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
    07/06/22 15:51:15 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:712)
    07/06/22 15:51:15 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)
    07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)
    07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)
    07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)
    07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
    07/06/22 15:51:15 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
    07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
    07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
    07/06/22 15:51:15 at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
    07/06/22 15:51:15 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    07/06/22 15:51:15 at java.lang.Thread.run(Thread.java:595)
    What may be causing this exception.

    I have solved the problem. It had to do with the autocommit=true feature of the MYSQL connection. However I have ran into another trouble. I am getting the following exception.
    java.lang.IllegalStateException: Can not call getPrimaryKey() inside ejbCreate(...) methods, the entity does not have an identity yet, see the EJB 2.0 specification chapter 10.5.4
         at com.evermind.server.ejb.EJBUtils.throwGetPrimaryKeyInEJBCreateException(EJBUtils.java:892)
         at EmployeeRemote_EntityBeanWrapper0.getPrimaryKey(EmployeeRemote_EntityBeanWrapper0.java:1686)
         at EmployeeHome_EntityHomeWrapper2.create(EmployeeHome_EntityHomeWrapper2.java:1055)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    java.lang.IllegalStateException: Can not call getPrimaryKey() inside ejbCreate(...) methods, the entity does not have an identity yet, see the EJB 2.0 specification chapter 10.5.4
         at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:109)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:125)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:517)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:461)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at __Proxy0.create(Unknown Source)
         at com.pd.model.EmployeeRemoteClient.main(EmployeeRemoteClient.java:37)
    I am not calling getPrimaryKey() in ejbCreate() then why this exception

  • Remove fails for entity ejb

    Hi
    remove is failing on my entity beans. The exception I get is
    javax.ejb.EJBException: Error saving state: ORA-01407: cannot update ("AXIS_LIVE_DBO"."MEMBER_LOCATIONS"."MEMBER_REF") to NULL
    MEMBER_REF is the primary key of the table and cannot be null. Does OC4J need the primary key field to be nullable?

    I am having the same issue. I currently have a M:M relationship that is bombing out on a remove call. The code seems to work fine on 9.0.4.1.0 standalone version on Windows. When I migrate the code to our 10G linux box, which is version 9.0.4.0.0. running the latest patch, I get the following error. I also tried the code on version 10.1.2.0.0 and I get the same error. If I change the foreign key columns to nullable the remove works file. Making the foreign keys nullable defeats the purpose of having data integrity. I have also enclosed the SQL generated by the container.
    Error in Requisition Model removeVendor:
    com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: javax.ejb.EJBException: Error saving state: ORA-01407: cannot update ("FINANCEDEV"."REQ_SUGG_VENDOR"."RQ_ID") to NULL
         at RequisitionSession_StatelessSessionBeanWrapper5.removeVendor(RequisitionSession_StatelessSessionBeanWrapper5.java:724)
         at edu.suny.sysadm.finance.procurement.model.RequisitionModel.removeVendor(RequisitionModel.java:382)
         at edu.suny.sysadm.finance.procurement.struts.action.VendorRemoveAction.execute(VendorRemoveAction.java:53)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    Works
    1109613632663|16|3|statement|update REQ_SUGG_VENDOR set RQ_ID = ? where RQ_SUGG_VND_ID = ?|update REQ_SUGG_VENDOR set RQ_ID = 1422 where RQ_SUGG_VND_ID = 374
    Does not work.
    1109613500250|92|2|statement|update REQ_SUGG_VENDOR set RQ_ID = ? where RQ_SUGG_VND_ID = ?|update REQ_SUGG_VENDOR set RQ_ID = '' where RQ_SUGG_VND_ID = 370

  • HELP - ERROR INVOKING ENTITY EJB METHOD

    Hi,
    I keep getting a java.rmi.NoSuchObject exception when using my entity ejb, but cannot see why, as I already have the ejb in a collection... code & stack trace below: Any one know what is causing this ??
    java.rmi.NoSuchObjectException: com.syntegra.cec.insurance.entity.AATreportPK@7a6c34
    java.rmi.NoSuchObjectException: com.syntegra.cec.insurance.entity.AATreportPK@7a6c34 at AATreport_EntityBeanWrapper14.getPayment_reference(AATreport_EntityBeanWrapper14.java:1881) at com.syntegra.cec.insurance.dtofactory.RecordsDTOFactoryBean.fetchAAT(RecordsDTOFactoryBean.java:151) at com.syntegra.cec.insurance.dtofactory.RecordsDTOFactoryBean.fetchRecords(RecordsDTOFactoryBean.java:62) at RecordsDTOFactory_StatelessSessionBeanWrapper49.fetchRecords(RecordsDTOFactory_StatelessSessionBeanWrapper49.java:108)
    HashMap records = new HashMap();
    Collection theEJBs = null;
    int counter = 0;
    //Find the beans
    AATreportHome home = (AATreportHome)lookUpHome
    (com.syntegra.cec.insurance.entity.AATreportHome.class,
    "AATreport");
    theEJBs = home.findByStatus(type);
    //Populate the DTO's
    if(theEJBs != null)
    Iterator it = theEJBs.iterator();
    while(it.hasNext())
    AATreport theEJB = (AATreport)it.next();
    AATreportDTO theDTO = new AATreportDTO
    ----- This is where the error comes from --
    ---Line 151 ---(theEJB.getPayment_reference(),
    theEJB.getTenant_ref_no(),
    theEJB.getInsurance_no(),
    theEJB.getName(),
    theEJB.getAddress_line_1(),
    theEJB.getPremium(),
    getDateAsString(theEJB.getAction_date()));
    records.put(new Integer(counter), theDTO);
    counter++;

    Greetings,
    Hi,
    I am trying to access a bean from a JSP and have the
    foll. code piece:
    <%
    String op="";
    try {
    // Contact the AccountBean container (the "AccountHome") through JNDI.
    Context ctx = getInitialContext();
    out.println("initial context got !!");
    DemoHome home = (DemoHome) ctx.lookup("demo.DemoHome");
    out.println("home got !!");Though it doesn't seem to be the problem in this case, good EJB coding practices dictate that your code should be narrowing the home reference before calling any of it's methods (i.e. create(...) )... WebLogic may allow handling of its protocol objects in their native state, but other vendors do not... your application is not portable without narrowing.
    It gives an error on trying to access the method "demoSelect".
    e.printStackTrace gives the output:
    java.lang.RuntimeException: javax.ejb.EJBContext.getEnvironment is deprecated inThe error is not in your JSP, but in the bean... it seems your bean is attempting to acquire its "environment properties" in the pre-1.1 style, when...
    EJB 1.1. EJB 1.1 compliant containers are not required to implement this
    method. Use java:comp/env instead. ...instead, it should be looking them up in its JNDI namespace.
    What is wrong???
    pls help! Regards,
    Tony "Vee Schade" Cook

  • Diference between remove method of EJBhome and ejbobject

    Whats the differece between remove() gven in EJBObject and remove in EJBHome and when to use which.
    TIA

    additional info. if you would like to ponder more.
    Handles
    Handles are a serialisable reference to a particular EJB or EJB Home object. As they are serialisable they can be stored for later use in a persistent store such as a file or database.
    We can get a handle to an EJB's Home object using the method getHandle(). This method is defined in the interface javax.ejb.EJBHome and is implemented by the container.
    Once we have a home handle we can get a reference to the Home object using the method getEJBHome().
    We can also get handles for EJB's using the method EJBObject.getHandle() (EJBObject is the interface that all EJB remote interfaces extend). Once we have a handle we can invoke getEJBObject() to re-create a valid remote reference to the bean (if it still exists) and cast this reference to the appropriate type. We can also get a reference to the EJB home from an EJBObject, and use this home reference to get an EJBMetaData object.
    The EJB home object also defines the method remove(Handle h) to remove beans given their handle. For stateless session beans, invoking this method will make any further calls on the object referenced by the stub invalid. For stateful session beans, the reference also becomes invalid, with the corresponding loss of any session data maintained for the client using the handle.
    Invoking remove for an entity bean will physically delete the beans fields from the resource manager (database) and make the remote reference invalid.
    For entity beans handles are an alternative for the primary key, for session beans handles provide the only means of obtaining and storing a reference to the bean.
    from: http://www.csse.monash.edu.au/courseware/cse3450/Lectures/Module7/module.html

  • ConcurrentModificationException on remove call on an ejb

    Hi guys,
    I'm using weblogic7.0 sp1 and developping with JBuilder8.
    The following error appear when i try to remove an ejb. I'm iterating on an
    collection of primary key and i try to remove all ejb of this collection
    (source code at the bottom).
    The same source code is running on weblogic6.1sp2, have you already see this
    problem somewhere? Do you know if it's a programming error or an other
    thing?
    <Mar 19, 2003 10:25:54 AM CET> <Error> <T3Services> <000000> <M&H BOE Engine
    ERROR :
    java.util.ConcurrentModificationException
    at java.util.HashMap$HashIterator.next(HashMap.java:731)
    at
    weblogic.ejb20.internal.TxManager.flushModifiedBeans(TxManager.java:292)
    at
    weblogic.ejb20.manager.BaseEntityManager.flushModifiedBeans(BaseEntityManage
    r.java:1626)
    at
    weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.flushModifiedBeans(RDBMSPer
    sistenceManager.java:1945)
    at
    weblogic.ejb20.manager.BaseEntityManager.cascadeDeleteRemove(BaseEntityManag
    er.java:1202)
    at weblogic.ejb20.manager.DBManager.remove(DBManager.java:1024)
    at
    weblogic.ejb20.internal.EntityEJBLocalObject.remove(EntityEJBLocalObject.jav
    a:102)
    at
    com.mh.app.boe.engine.dba.instanceprocess.InstanceProcessBean_n65kai_ELOImpl
    .remove(InstanceProcessBean_n65kai_ELOImpl.java:1015)
    at
    com.mh.app.boe.engine.model.EngineWorker.removeProcess(EngineWorker.java:513
    at
    com.mh.app.boe.engine.model.EngineWorker.modifyProcesses(EngineWorker.java:4
    57)
    at
    com.mh.app.boe.engine.model.EngineWorker.dealEvent(EngineWorker.java:280)
    at
    com.mh.app.boe.engine.model.EngineWorker.dealEvent(EngineWorker.java:226)
    at
    com.mh.app.boe.engine.model.EngineWorker.progressInstanceByStep(EngineWorker
    .java:402)
    at
    com.mh.app.boe.engine.model.EngineWorker.progressInstance(EngineWorker.java:
    303)
    at
    com.mh.app.boe.engine.model.EngineWorker.dealEvent(EngineWorker.java:284)
    at
    com.mh.app.boe.engine.model.EngineWorker.dealEvent(EngineWorker.java:226)
    at
    com.mh.app.boe.engine.model.EngineWorker.dealEvent(EngineWorker.java:205)
    at
    com.mh.app.boe.engine.model.EngineBean.dealEvent(EngineBean.java:89)
    at
    com.mh.app.boe.engine.model.EngineBean_yehaoy_ELOImpl.dealEvent(EngineBean_y
    ehaoy_ELOImpl.java:99)
    at
    com.mh.app.boe.engine.net.EngineControllerEJBBean.dealEvent(EngineController
    EJBBean.java:74)
    at
    com.mh.app.boe.engine.net.EngineControllerEJBBean_agu4tb_EOImpl.dealEvent(En
    gineControllerEJBBean_agu4tb_EOImpl.java:262)
    at
    com.mh.app.boe.engine.net.EngineControllerEJBBean_agu4tb_EOImpl_WLSkel.invok
    e(Unknown Source)
    at
    weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :114)
    at
    weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:821)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    >
    Collection precedentProcesses =
    process.findPrecedentProcesses(processIdToActivate, stateMachineId);
    for (Iterator precedentProcessesIterator = precedentProcesses.iterator();
    precedentProcessesIterator.hasNext(); ) {
    String precedentProcessId = (String) precedentProcessesIterator.next();
    InstanceProcessPK instanceProcessPKToPassivate = new
    InstanceProcessPK(instance.getInstanceId(),
    processIdToPassivate,instance.getStateMachineId());
    InstanceProcess instanceProcessToPassivate =
    serviceLocator.getInstanceProcessHome().findByPrimaryKey(instanceProcessPKTo
    Passivate);
    if (instanceProcessToPassivate != null)
    instanceProcessToPassivate.remove(); //exception is thows on this
    instruction
    Thanks in advance,
    Joel.

    Hello Ryan,
    There are no other threads of execution that try to access to this
    collection of InstanceProcess in my code.
    Could it be the application server?
    Nota: I 'm using transaction managed by container.
    Best regards,
    Joel.
    "Ryan LeCompte" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hello Joel,
    After giving your code a second look, it appears that the Collectionreturned
    by your finder method is composed of Strings, and not the actual localinterfaces
    of the underlying entity beans. Are you sure that there aren't otherthreads of
    execution that are iterating through a collection of InstanceProcesses'while
    you are calling the remove() method of the current InstanceProcess in thecode
    that you wrote?
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Ryan LeCompte" <[email protected]> wrote:
    Hello Joel,
    You should remove your particular bean instance by calling the remove()
    method
    on the Iterator object as opposed to calling the remove() method directly
    on the
    local interface of the entity bean. The latter will generate the
    ConcurrentModificationException(),
    because the underlying collection will be modified while you areiterating
    through
    it, which generates the exception. This is because thecollection/iterator
    is
    "fail-safe." Therefore, in your code you would callprecedentProcessesIterator.remove()
    instead of instanceProcessToPassivate.remove();
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Joel Rolland" <[email protected]> wrote:
    Hi guys,
    I'm using weblogic7.0 sp1 and developping with JBuilder8.
    The following error appear when i try to remove an ejb. I'm iterating
    on an
    collection of primary key and i try to remove all ejb of this collection
    (source code at the bottom).
    The same source code is running on weblogic6.1sp2, have you alreadysee
    this
    problem somewhere? Do you know if it's a programming error or an other
    thing?
    <Mar 19, 2003 10:25:54 AM CET> <Error> <T3Services> <000000> <M&H BOE
    Engine
    ERROR :
    java.util.ConcurrentModificationException
    at java.util.HashMap$HashIterator.next(HashMap.java:731)
    at
    weblogic.ejb20.internal.TxManager.flushModifiedBeans(TxManager.java:292)
    at
    weblogic.ejb20.manager.BaseEntityManager.flushModifiedBeans(BaseEntityMana
    ge
    r.java:1626)
    at
    weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.flushModifiedBeans(RDBMSP
    er
    sistenceManager.java:1945)
    at
    weblogic.ejb20.manager.BaseEntityManager.cascadeDeleteRemove(BaseEntityMan
    ag
    er.java:1202)
    at weblogic.ejb20.manager.DBManager.remove(DBManager.java:1024)
    at
    weblogic.ejb20.internal.EntityEJBLocalObject.remove(EntityEJBLocalObject.j
    av
    a:102)
    at
    com.mh.app.boe.engine.dba.instanceprocess.InstanceProcessBean_n65kai_ELOIm
    pl
    ..remove(InstanceProcessBean_n65kai_ELOImpl.java:1015)
    at
    com.mh.app.boe.engine.model.EngineWorker.removeProcess(EngineWorker.java:5
    13
    at
    com.mh.app.boe.engine.model.EngineWorker.modifyProcesses(EngineWorker.java
    :4
    57)
    at
    com.mh.app.boe.engine.model.EngineWorker.dealEvent(EngineWorker.java:280)
    at
    com.mh.app.boe.engine.model.EngineWorker.dealEvent(EngineWorker.java:226)
    at
    com.mh.app.boe.engine.model.EngineWorker.progressInstanceByStep(EngineWork
    er
    ..java:402)
    at
    com.mh.app.boe.engine.model.EngineWorker.progressInstance(EngineWorker.jav
    a:
    303)
    at
    com.mh.app.boe.engine.model.EngineWorker.dealEvent(EngineWorker.java:284)
    at
    com.mh.app.boe.engine.model.EngineWorker.dealEvent(EngineWorker.java:226)
    at
    com.mh.app.boe.engine.model.EngineWorker.dealEvent(EngineWorker.java:205)
    at
    com.mh.app.boe.engine.model.EngineBean.dealEvent(EngineBean.java:89)
    at
    com.mh.app.boe.engine.model.EngineBean_yehaoy_ELOImpl.dealEvent(EngineBean
    _y
    ehaoy_ELOImpl.java:99)
    at
    com.mh.app.boe.engine.net.EngineControllerEJBBean.dealEvent(EngineControll
    er
    EJBBean.java:74)
    at
    com.mh.app.boe.engine.net.EngineControllerEJBBean_agu4tb_EOImpl.dealEvent(
    En
    gineControllerEJBBean_agu4tb_EOImpl.java:262)
    at
    com.mh.app.boe.engine.net.EngineControllerEJBBean_agu4tb_EOImpl_WLSkel.inv
    ok
    e(Unknown Source)
    at
    weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.ja
    va
    :114)
    at
    weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceMana
    ge
    r.java:821)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:308
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java
    :3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    >
    Collection precedentProcesses =
    process.findPrecedentProcesses(processIdToActivate, stateMachineId);
    for (Iterator precedentProcessesIterator =precedentProcesses.iterator();
    precedentProcessesIterator.hasNext(); ) {
    String precedentProcessId = (String)precedentProcessesIterator.next();
    >>>
    InstanceProcessPK instanceProcessPKToPassivate = new
    InstanceProcessPK(instance.getInstanceId(),
    processIdToPassivate,instance.getStateMachineId());
    InstanceProcess instanceProcessToPassivate =
    serviceLocator.getInstanceProcessHome().findByPrimaryKey(instanceProcessPK
    To
    Passivate);
    if (instanceProcessToPassivate != null)
    instanceProcessToPassivate.remove(); //exception is thows on this
    instruction
    Thanks in advance,
    Joel.

  • Removing a CMP Entity Bean

    I'm trying to remove a CMP Entity Bean from my project but after I do this the application becomes useless. When I start the application afterwards I get such a warning:
    "TopLink found problems in toplink-ejb-jar. Please ensure that there are corrected before deployment"
    After that, at runtime, there are lots of DescriptorExceptions, IntegrityExceptions and NullPointerExceptions. When I added the bean once more I get a bunch of compilation errors because of multiple declarations of the bean methods. I removed the bean once again, closed JDeveloper and removed all reference to that bean within the project (grep). Despite that I am unable to get rid of the aforementioned errors. What should I do?

    I'm trying to remove a CMP Entity Bean from my project but after I do this the application becomes useless. When I start the application afterwards I get such a warning:
    "TopLink found problems in toplink-ejb-jar. Please ensure that there are corrected before deployment"
    After that, at runtime, there are lots of DescriptorExceptions, IntegrityExceptions and NullPointerExceptions. When I added the bean once more I get a bunch of compilation errors because of multiple declarations of the bean methods. I removed the bean once again, closed JDeveloper and removed all reference to that bean within the project (grep). Despite that I am unable to get rid of the aforementioned errors. What should I do?

  • Is there an MBean for a deployed entity EJB?

    Hi,
    I need to access the method invocation times, availability, remove count, create count etc. of a deployed entity EJB through JMX MBean, in JBoss.
    I have deployed the entity bean and the stateless DAO bean that operates on the entity bean. I do find an MBean for this DAO in the JMX-console of JBoss, but not an MBean for the entity EJB.
    a) Why do I not find an MBean for the same?
    b) How is it possible to get the MBean created for the entity EJB?
    Speedy help solicited.
    Thanks a bunch in advance guys !

    When executing an operation via JMX using JConsole, I get the following error:
    Problem invoking getManifest : java.rmi.UnmarshallException: Error unmarshalling return: nested is: java.lang.ClassNotFoundException: foo.bar.InernalServiceException (no security manager: RMI class loader disabled)
    Code snippet:
    public ArrayList getManifest(String s) throws InternalServiceException, MBeanException{
    String path = ".\\foo_services.jar"; // Invalid path on purpose to test exception...
    File file = new File(path);
    FileInputStream fileInput;
    try {
    fileInput = new FileInputStream(file);
    } catch (FileNotFoundException e) {
    String msg = "The manifest file is not found in the given path";
    if (logger.isErrorEnabled()) logger.error(msg);
    throw new InternalServiceException(msg, ErrorConstants.JMX_FILE_NOT_FOUND);
    If I throw new RuntimeException(msg, e) instead of InternalServiceException(msg, ErrorConstants.JMX_FILE_NOT_FOUND), it works and I get the appropriate exception.
    What is the reason for this?

  • Why BC4J if Entity EJB is available

    Hi,
    I've been working on learning the BC4J framework for the last couple of weeks and initially I was very pleasently surprised - it really looked like this was the way forward. BUT - now that I've matured past the 'trivial applications make me happy' stage, I feel like I've hit a brick wall - something as simple as adding a (row - or should I say object) method and actually getting it called from a client application seems to involve hours browsing the 'not so helpful' documentation, and it still does not work. So now I'm forced to rethink this approach and the recent annoucement of EJB 1.1 support in 8.1.7 made me pose the question:
    What is BC4J except an attempt to patch up the missing entity bean support ? So far I've come up short and I would like to ask if there are others who think the same (or not - I'm just trying to get the picture so to speak :-)).
    It will also be quite simpel to program the buisness classes in Java, class test them and then deploy - generating the home and remote interfaces automatically. So I fail to see what BC4J gives me that I do not get by going the entity EJB route.
    What do you guys think - am I just rambling ?
    br
    Jacob

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    If you've already tried a complete uninstall and reinstall try opening iTunes in safe mode (hold down CTRL+SHIFT) as you start iTunes, then going to Edit > Preferences > Store and turning off Show iTunes in the Cloud purchases. You may find iTunes will now start normally.
    tt2

  • Clustering read-only bean-managed entity ejbs

              I'm designing a data caching approach that relies on using read-only entity ejbs with bean-managed persistence. My design is based on the fact that WebLogic blocks on entity bean access by concurrent users for a given bean instance (unique primary key). I would like to keep only one entity bean instance active(timeoutSetting=0) for eacy primary key for all users to share. That way I only have to hit the database one time to initially populate data in the entity bean. I'm worried about this approach in a WebLogic clustered environment. From reading notes in this newsgroup and other doc, it appears that WebLogic might not use one instance of the entity bean (based upon unique primary key) in a clustered environment. Is that true (that being multiple users could get their own instance of the entity bean with the same primary key)?
              Thanks,
              Bryan
              

    Typically, the read-write EJBs are on each WL server instance, so there is
              no remote invocation -- it is all done by reference.
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "Bryan Dixon" <[email protected]> wrote in message
              news:[email protected]...
              >
              > I guess I'm confused about read-write (not read-only) entity beans being
              pinned or not. This is from WebLogic 5.1 EJB doc:
              > "read-write entity EJBs do not use a clustered EJBObject stub; a client's
              method calls to a particular EJB always go to a single WebLogic Server
              instance. If the server that a client is using fails, the client must
              re-find the entity EJB using the cluster-aware home stub."
              >
              > Doesn't that mean the entity bean instance for a primary key is pinned to
              a single WebLogic Server instance? Maybe I'm just misunderstanding
              terminology about what a "particular EJB" is - I was thinking it is an
              entity bean instance for a unique primary key.
              >
              > Thanks,
              > Bryan
              >
              >
              > "Cameron Purdy" <[email protected]> wrote:
              > >>I was thinking that read-write entity beans were pinned.
              > >
              > >Not unless you pin them. Basically, that means that the JAR/XML that
              > >contains/specifies the EJB only is on one server.
              > >
              > >> So if two separate weblogic instances in a cluster did a find on an
              entity
              > >ejb with the same primary key and then performed some business method on
              > >that entity ejb, would there really be two separate bean instances in
              each
              > >weblogic instance for the same primary key?
              > >
              > >If it is not pinned, yes.
              > >
              > >--
              > >Cameron Purdy
              > >Tangosol, Inc.
              > >http://www.tangosol.com
              > >+1.617.623.5782
              > >WebLogic Consulting Available
              > >
              > >
              > >"Bryan Dixon" <[email protected]> wrote in message
              > >news:[email protected]...
              > >>
              > >> Toa, thanks again.
              > >>
              > >> There are a couple of things I'm not clear about though. One is that I
              > >want one instance of an entity bean per primary key, not a singleton of
              the
              > >entity bean itself. How would JNDI in a clustered environment help me
              > >there?
              > >>
              > >> The other question I have is about having multiple instances of an
              entity
              > >bean for the same primary key in the cluster. I was thinking that
              > >read-write entity beans were pinned. So if two separate weblogic
              instances
              > >in a cluster did a find on an entity ejb with the same primary key and
              then
              > >performed some business method on that entity ejb, would there really be
              two
              > >separate bean instances in each weblogic instance for the same primary
              key?
              > >>
              > >> Thanks again,
              > >> Bryan
              > >>
              > >> "Tao Zhang" <[email protected]> wrote:
              > >> >
              > >> >"Bryan Dixon" <[email protected]> wrote:
              > >> >>
              > >> >>The reason I was wanting one instance per primary key is that I want
              to
              > >use this entity bean to cache some data from database tables. This data
              > >doesn't change frequently, so we were wanting to get it from this entity
              > >bean's memory instead of constantly hitting the database. This data is
              > >global to all users, so we don't want to store it in stateful session
              beans.
              > >> >>
              > >> >>After reading more about the read-only cache-strategy it doesn't
              appear
              > >that any sycnhronization will occur if the entity bean for a given
              primary
              > >key is updated (state data is updated) in one weblogic instance, that
              change
              > >will not get synced up with other weblogic instances for that same
              primary
              > >key. Is that correct?
              > >> >>
              > >> >It's correct. If you do want to have exact one copy in the cluster.
              You
              > >can read Using JNDI in cluster environment.
              > >> >
              > >> >>If I deploy this entity bean with read-write cache-strategy the
              WebLogic
              > >doc reads as if I will get one instance per primary key that is pinned to
              > >one WebLogic instance and I won't get any fail-over or load-balancing on
              the
              > >ejbObject (the entity bean instance). Did I read this correctly? If
              that
              > >is the case, what is the advantage of setting up read-write entity beans
              to
              > >be clusterable - just the Home objects? I definitely could be
              > >misunderstanding something in the doc since I'm very new to clustering.
              > >> "Tao
              > >> >Zhang"
              > >> ><[email protected]> wrote:
              > >> >>>
              > >> >
              > >> >It's not only instance in the cluster. Probably many instances.
              > >> >
              > >> >If you use 2 tier clustering, failover will not happen because of
              > >co-location. But if you use 3 tier cluster, you can write the special
              code
              > >in the client side to do failover and load-balance.
              > >> >
              > >> >In a 2 tier cluster, actually the ejb load balancing and failover is
              > >almost useless.
              > >> >
              > >> >But in 3 tier, you can use it.
              > >> >
              > >> >Hope this help.
              > >> >
              > >> >
              > >> >
              > >> >>>"Bryan Dixon" <[email protected]> wrote:
              > >> >>>>
              > >> >>>>Thanks Tao.
              > >> >>>>
              > >> >>>>A couple more questions...
              > >> >>>>I was planning deploying this entity bean with the read-only
              > >cache-strategy which means our transaction attribute would be
              > >TXN_NOT_SUPPORTED. Also, our db isolation is TRANSACTION_READ_COMMITTED.
              > >> >>>>
              > >> >>>>Based upon how I was planning on deploying this entity bean, would
              > >WebLogic create an instance of the bean for each primary key in each
              > >cluster? I'm just trying to figure out how many duplicate bean instances
              > >for the primary key I could have across all clusters. I was really just
              > >wanting one instance that is shared among all clients and was hoping that
              > >the clustering would provide me with fail-over if that one cluster went
              > >down.
              > >> >>>>
              > >> >>>If you use 3 tier cluster structure, it's impossible to know how
              many
              > >instances of ejb with the same primary key. Probably one instance for
              each
              > >wls instance.
              > >> >>>In wls5.1, it's impossible to host only read only entity bean
              instance
              > >in the 3-tier cluster. Because read only entity bean are clusterable in
              both
              > >home and remote interface.
              > >> >>>
              > >> >>>>Regarding making the bean a pinned service, which it sounds like I
              > >might have to do to get the results I want, how do I do that? Is that a
              > >deployment descriptor setting? Also, if I make it a pinned service, do I
              > >get any fail-over suport by clustering the bean?
              > >> >>>>
              > >> >>>For the pinned service, you can just deployed on one or several
              server
              > >instances. The per-server properties file is a good place to put the
              > >weblogic.ejb.deploy property. If only one pinned service in the cluster,
              you
              > >can't get fail over. If the that server instance fails, the home stub
              will
              > >be removed from the jndi in other server instances.
              > >> >>>
              > >> >>>Why do you must need only one instance in the cluster? Do you want
              > >exact-only-copy? You can read Using JNDI doc about its in cluster
              > >environment.
              > >> >>>
              > >> >>>
              > >> >>>
              > >> >>>
              > >> >>>>Thanks again,
              > >> >>>>Bryan
              > >> >>>>
              > >> >>>>
              > >> >>>>
              > >> >>>>"Tao Zhang" <[email protected]> wrote:
              > >> >>>>>
              > >> >>>>>
              > >> >>>>>Bryan Dixon <[email protected]> wrote in message
              > >> >>>>>news:[email protected]...
              > >> >>>>>>
              > >> >>>>>> I'm designing a data caching approach that relies on using
              > >read-only
              > >> >>>>>entity ejbs with bean-managed persistence. My design is based on
              the
              > >fact
              > >> >>>>>that WebLogic blocks on entity bean access by concurrent users for
              a
              > >given
              > >> >>>>>bean instance (unique primary key). I would like to keep only one
              > >entity
              > >> >>>>>bean instance active(timeoutSetting=0) for eacy primary key for
              all
              > >users to
              > >> >>>>>share. That way I only have to hit the database one time to
              > >initially
              > >> >>>>>populate data in the entity bean. I'm worried about this approach
              in
              > >a
              > >> >>>>>WebLogic clustered environment. From reading notes in this
              newsgroup
              > >and
              > >> >>>>>other doc, it appears that WebLogic might not use one instance of
              the
              > >entity
              > >> >>>>>bean (based upon unique primary key) in a clustered environment.
              Is
              > >that
              > >> >>>>>true (that being multiple users could get their own instance of
              the
              > >entity
              > >> >>>>>bean with the same primary key)?
              > >> >>>>>>
              > >> >>>>>
              > >> >>>>>
              > >> >>>>>It's true. In a cluster environment, each wls instance can have
              their
              > >ejb
              > >> >>>>>instance. The block of concurrent access to the ejb data is up to
              > >your
              > >> >>>>>transaction attribute and isolation level and your database.
              > >> >>>>>
              > >> >>>>>If you only want to keep one instance active, you can make the
              > >read-only
              > >> >>>>>entity bean a pinned service, to be deployed in one instance. But
              the
              > >> >>>>>network overhead is worse.
              > >> >>>>>
              > >> >>>>>
              > >> >>>>>> Thanks,
              > >> >>>>>> Bryan
              > >> >>>>>
              > >> >>>>>
              > >> >>>>
              > >> >>>
              > >> >>
              > >> >
              > >>
              > >
              > >
              >
              

  • How to use the same Entity EJB to access the same table in 2 syb databases

    We are trying to convert an application to J2EE. We have the following
    concern. The application requires the use of 10 sybase databases with
    identical tables. One database per branch. We would like to be able to use the same set of entity EJBs to access all databases.
    One solution we can think of is to use bmp entity beans and have a dispatcher session bean pass the database that the entity bean has to connect to.
    Would it work?
    Is there a more elegant way to do this?

    I don't know if there is a more elegant way to do it, but that will work. I have a similar scenario, one database per customer. You'll have to use BMP and get your connections based on the branch.
    Each one of my DAO methods requires that a customer ID be passed in for each method. The customer ID is part of the primary key for each entity bean; therefore, if I need to find a deposit (entity) for a customer, I pass the customer ID and deposit ID to my session facade, create the PK using these, do a findByPrimaryKey, etc. In the ejbLoad, I use the customer ID and the deposit ID to pass into the DAO. There, another class (ConnectionFactory) returns a proper connection based on the customer ID passed, which I use to do my queries.
    Paul

  • Oracle Dabase Schema with OC4J CMP Entity EJB

    I have tables in a schema called vsxlib. My Entity EJBs that map to SQL SERVER tables (no schema) work perfectly. My Entity CMP EJBs that connect need to connect to the vsxlib schema only partially work.
    The findAll method works. When I add a where clause, I get no results back.
    When I try a findByPrimaryKey, I get a ObjectNotFoundException.
    Does OC4J version 9.0.3 support database schemas? There were examples posted at http://otn.oracle.com/sample_code/tech/java/j2ee/javacookbook/transactionsample/readme.html#descfiles say that they have an Entity bean working within a db schema.
    Could it be permission related????
    I even tried creating a synonym pointing to the table within the vsxlib schema.. No Luck.
    I had this same problem with JBoss3.2 and found out that they did not support db schemas. That is why I was wanting to switch to OC4J because I thought for sure, being an oracle product that it would support db schemas.
    Any help is greatly appreciated.

    Hi Alex,
    I think you may be misunderstanding the meaning of 'database schemas'. For your information, in the Oracle database, a schema is the same as a database user. For example all the database tables belonging to user SCOTT (TIGER) are said to be in the SCOTT schema.
    OC4J uses the term 'database schema' differently. Here it refers to the mapping of database datatypes to java classes. Look at the "j2ee/home/config/database-schemas" subdirectoryof the OC4J installation for more details. The "data-sources.xml" file has a 'schema' tag (not sure if that's the correct name) which points OC4J to the datatype mapping XML file -- usually one of those that come with the distribution. However, I use OC4J stand-alone version and I don't need to worry about the mappings at all -- OC4J already knows the mappings for an Oracle database (I assume).
    In order to access a particular Oracle schema, I merely have to log in to the database as the appropriate user. So, using the previous example, if I configure the "data-sources.xml" file to use 'scott' as the database login, then OC4J can access the SCOTT schema. You can find more details about Oracle's use of the term 'schema' in the Oracle documentation, which is available from:
    http://tahiti.oracle.com
    Hope this has answered your question.
    Good Luck,
    Avi.

  • Howto call the @Remove method of a stateful session bean after JSF page ...

    I use EJB3, JPA, JSF in my web application. There are 2 database tables: Teacher and Student. A teacher can have many (or none) students and a student can have at most 1 teacher.
    I have a JSF page to print the teacher info and all his students' info. I don't want to load the students' info eagerly because there's another JSF page I need to display the teacher info only. So I have a stateful session bean to retrieve the teacher info and all his students' info. The persistence context in that stateful session bean has the type of PersistenceContextType.EXTENDED. The reason I choose a stateful session bean and an extended persistence context is that I want to write something like this without facing the lazy initialization exception:
    <h:dataTable value="#{backingBean.teacher.students}" var="student">
        <h:outputText value="${student.name}"/>
    </h:dataTable>Because my session bean is stateful, I have a method with the @Remove annotation. This method is empty because I don't want to persist anything to the database.
    Now, my question is: How can I make the @Remove method of my stateful session bean be called automatically when my JSF page finishes being rendered?

    Philip Petersen wrote:
    I have a few questions concerning the EJB remove method.
    1) What is the purpose of calling the remove method on stateless session
    bean?There isn't one.
    >
    2) What action does the container take when this method is called?It checks that you were allowed to call remove (a security check) and then
    just returns.
    >
    3) What happens to the stateless session bean if you do not call the remove
    method?Nothing
    >
    4) Is it a good practice to call the remove method, or should the remove
    method be avoided in the case of stateless session beans?
    Personally, I never do it.
    -- Rob
    >
    >
    Thanks in advance for any insight that you may provide.
    Phil--
    AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnWebLogic.com
    [att1.html]

  • ORA-01407 when removing a CMP Entity Bean with WLS 9.1

    Hi all !
    I hope you can help me to solve this ?:|
    I'm migrating my application from WLS 8.1 SP3 to WLS 9.1.
    I'm getting now an SQLException when I try to remove a CMP Entity Bean.
    The stacktrace is as follows:
    java.sql.SQLException: ORA-01407: cannot update ("USER"."MY_TABLE"."THE_CMR_FIELD") to NULL
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1120)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1278)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3415)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3498)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:128)
    Of course, I replaced the table and column names above to be more readable ;-)
    The table MY_TABLE has a CMR field called THE_CMR_FIELD. The column is not nullable in the database (by the way, it's an Oracle 9i).
    Everything is fine under WLS8.1
    I tried two different Oracle JDBC drivers (9.2.0.5 and 10.2.0.1.0), but the result is always the same within WLS9.1.
    Any ideas or suggestions (or even questions) are more than welcome!
    Thanks
    Eric

    What's even more weird is that I have what seams to be the same problem on Weblogic 6.1 (SP4).
    Here's the stacktrace:
    <pre>
    javax.ejb.EJBException:
    Start server side stack trace:
    java.sql.SQLException: ORA-01407: cannot update ("SCHEMA"."TIM_WP_DAY_CORE_PERIODS"."TWD_ID") to NULL
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
         at com.p6spy.engine.logging.P6LogPreparedStatement.executeUpdate(P6LogPreparedStatement.java:183)
         at weblogic.jdbc.jts.Statement.executeUpdate(Statement.java:503)
         at package.WorkPatternDayCorePeriods_vd9y46__WebLogic_CMP_RDBMS.__WL_store(WorkPatternDayCorePeriods_vd9y46__WebLogic_CMP_RDBMS.java:2317)
         at weblogic.ejb20.manager.DBManager.flushModified(DBManager.java:438)
         at weblogic.ejb20.internal.TxManager$TxListener.flushModifiedKeys(TxManager.java:552)
         at weblogic.ejb20.internal.TxManager.flushModifiedBeans(TxManager.java:298)
         at weblogic.ejb20.manager.BaseEntityManager.flushModifiedBeans(BaseEntityManager.java:1246)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.flushModifiedBeans(RDBMSPersistenceManager.java:1106)
         at weblogic.ejb20.manager.BaseEntityManager.cascadeDeleteRemove(BaseEntityManager.java:840)
         at weblogic.ejb20.manager.DBManager.remove(DBManager.java:656)
         at weblogic.ejb20.internal.EntityEJBLocalObject.remove(EntityEJBLocalObject.java:97)
         at package.WorkPatternDayCorePeriodsEJB_vd9y46_ELOImpl.remove(WorkPatternDayCorePeriodsEJB_vd9y46_ELOImpl.java:722)
         at package.PersonWorkPatternBC.removeWorkPatternDay(PersonWorkPatternBC.java:571)
         at package.remove(PersonWorkPatternBC.java:708)
         at package.TimPersonCalendarServiceEJB.removeWorkPattern(TimPersonCalendarServiceEJB.java:140)
    </pre>
    In fact I have this setup:
    <pre>
    workpattern 1..n workpatternday -| 1..n dayperiod
    | 1..n daycoreperiod
    </pre>
    And before 'ejbRemove'ing the workpattern I first remove the days and before that the periods and core periods.
    I start with the periods and instead of removing them in the DB he tries to update the FK to the day with '' (p6spy result).
    When I remove the not null constraint on the foreign key everything passes to the day where the workpatternId cannot be set to null.
    He does not throw errors on the coreperiod (where the not null constraint to day is still present).
    When I invert the sequence of deleting
    (first the core periods then the 'regular' periods) he complains about the dayId on the core periods table.
    So it's completely absurd :S
    I hope weblogic 8.1 might solve this problem as this development code is still to be migrated to 8.1 before going in production...
    I would just like to know what's wrong. There are other places with just about the same relationships (CMR and DB) where he does not complain...

  • How to set the isolation level on Entity EJBs

    I am using 10.1.3.3 of the OC4J app server.
    I am creating an application that uses EJB 2.1.
    I am trying to set the isolation levels on the EJBs to either serializable or repeatable read.
    When i deploy the EAR file from the OC4J admin console, i can set the isolation level property on the EJB's however when i inspect the orion-ejb-jar.xml file I do not see the isolation level being set. Furthermore, i tried to manually change the isolation setting by editing the orion-ejb-jar.xml and adding the isolation="serialiable" attribute on the entity bean descriptor. I then stopped and restarted the server. I noticed that my change was no longer in the file.
    Can someone please let me know how to solve this problem and set the isolation level on Entity EJBs . Thanks

    I find it at ejb.pdf from BEA.
              The transaction-isolation stanza can contain the elements shown here:
              <transaction-isolation>
              <isolation-level>Serializable</isolation-level>
              <method>
              <description>...</description>
              <ejb-name>...</ejb-name>
              <method-intf>...</method-intf>
              <method-name>...</method-name>
              <method-params>...</method-params>
              </method>
              </transaction-isolation>
              "Hyun Min" <[email protected]> wrote in message
              news:3c4e7a83$[email protected]..
              > Hi!
              >
              > I have a question.
              > How to set the transaction isolation level using CMT in descriptor?
              >
              > The Isolation level not supported in CMT?
              >
              > Thanks.
              > Hyun Min
              >
              >
              

Maybe you are looking for