Finders/CMP transactions

Hello,
I've got some weird behaviour happening on my finders.
I've got a CMP bean and a Session bean on top of it.
The session bean has a method that performs the following:
1 - creates an instance of the CMP bean
2 - updates an attribute on this instance of the CMP
3 - perform another find on the CMP.
Now the first 2 steps are ok. The 3rd step is a problem.
If I do a find by PK then it works.
But if I perform a custom finder that specifies one of the attributes that was updated in step 2, (eg, age=1, where age is an attribute on the CMP etc), then it doesn't return the CMP.
If I retrieve the bean at this point in time through a find by PK and check the updated attribute, it returns the updated value.
So it is as if the custom finder is some how executed in a different transaction from the rest of the method, as it doesn't see the fact that I've updated the attribute in step 2.
Note that if I call the custom finder in step 1, after creation, it works properly.
I've got the transaction attribute on the session bean to Requires and all the entity bean methods are set to Requires.
BTW, I'm using OC4J 1.0.2.2.1.
Any ideas,
Thanks!!!,
Ricky

you can find DuplicateKeyException is this place
http://java.sun.com/j2ee/1.4/docs/api/
javax.ejb.DuplicateKeyException.
DuplicateKeyException - exception javax.ejb.DuplicateKeyException.
The DuplicateKeyException exception is thrown if an entity EJB object cannot be created because an object with the same key already exists.
But I cannot find how to use DuplicateKeyException in SAP applications
Very Sorry.

Similar Messages

  • Just another cmp transaction question

    Hi
    I would like to know if it is possible to manage cmp transaction from the client code. For example I need to
    execute some business method several times but I don't want the container to commit transaction after each execute but only if all executes were successfull.
    Bartek

    I think I understand your post but my problem is rather different. I have a session bean with a business method named process(..) that receives as an argument a org.dom4j.Document object and does an proper action. I works fine when that process() method is called only one . But now I wan't to call it several times , each time with different org.dom4j.Document perhaps and want to have tha transaction commited only after complete whole process. I am quite new I ejbs so it is possible that is quite a silly question but I need surety that the only way to do this is to make an another session bean business method that gets as a parameter for example a collection of org.dom4j.Document objects.
    Thanks for help
    Bartek

  • User interference with CMP transaction (illegal termination of transaction)

    Folks,
    Have any one encountered this error before ? Let me know the root cause of this error if you do know about it.
    thx.
    Rajesh.

    Hello.
    The error occurs when the method SmsOmniServiceBean.proceedOMNI() calls REMOTELY the method SmsOmniServiceBean.proceedOMNIinternal(). What is important is that the call is a remote call (using JNDI, the home and remote interface) that creates a new transaction (the method proceedOMNIinternal() transaction is defined as "requiresNew" in the ejb-jar.xml). This is done on purpose. If the proceedOMNIinternal() transaction is rolled back, we do not want that the whole transaction is rolled back.
    Please note that the calling method proceedOMNI() is execute in a loop inside another method (proceedOMNIAll()), and the exception is thrown at some random point in the loop: sometimes near the middle, sometimes near the end.
    Please note also that no entity bean are used in our application, nor in another application deployed on the server, so why "User interference with CMP" ?
    Here is the stack trace:
    com.evermind.server.rmi.OrionRemoteException: User interference with CMP transaction (illegal termination of transaction)
         at SmsOmniService_StatelessSessionBeanWrapper92.proceedOMNIinternal(SmsOmniService_StatelessSessionBeanWrapper92.java:736)
         at com.bnpparibas.bfi.sms.server.ejb.SmsOmniServiceBean.proceedOMNI(SmsOmniServiceBean.java:223)
         at com.bnpparibas.bfi.sms.server.ejb.SmsOmniServiceBean.proceedOMNIAll(SmsOmniServiceBean.java:299)
         at SmsOmniService_StatelessSessionBeanWrapper92.proceedOMNIAll(SmsOmniService_StatelessSessionBeanWrapper92.java:479)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:479)
    Thank you in advance for your answer,
    Pierre Laroche

  • CMP Finders and Transactions

    Hello,
    I've got some weird behaviour happening on my finders.
    I've got a CMP bean and a Session bean on top of it.
    The session bean has a method that performs the following:
    1 - creates an instance of the CMP bean
    2 - updates an attribute on this instance of the CMP
    3 - perform another find on the CMP.
    Now the first 2 steps are ok. The 3rd step is a problem.
    If I do a find by PK then it works.
    But if I perform a custom finder that specifies one of the attributes that was updated in step 3, (eg, age=1, where age is an attribute on the CMP etc), then it doesn't return the CMP.
    If I retrieve the bean at this point in time through a find by PK and check the updated attribute, it returns the updated value.
    So it is as if the custom finder is some how executed in a different transaction from the rest of the method, as it doesn't see the fact that I've updated the attribute in step 2.
    Note that if I call the custom finder in step 1, after creation, it works properly.
    I've got the transaction attribute on the session bean to Requires and all the entity bean methods are set to Requires.
    BTW, I'm using OC4J 1.0.2.2.1.
    Any ideas,
    Thanks!!!,
    Ricky

    Hi Murtaza,
    Since you are posting your question to this forum, I will assume that you are using OC4J.
    Although I haven't tried it myself, you can define the SQL to be performed by your "finder" method in the "orion-ejb-jar.xml" file. If you do that, then you shouldn't use EJB-QL, since defining the (SQL) query in "orion-ejb-jar.xml" is intended to be used instead of EJB-QL.
    If I understand you correctly, then your SQL should be something like this:
    select
    from
       YOUR_TABLE
    where
       ID1 = nvl('id1', ID1)
    and
       ID2 = nvl('id2', ID2)
    and
       ID3 = nvl('id3', ID3)You will find information on "orion-ejb-jar.xml" at the following Web sites (not in any particular order):
    http://technet.oracle.com/tech/java/oc4j/content.html
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.atlassian.com
    http://www.elephantwalker.com
    Hope this helps you.
    Good Luck,
    Avi.
    P.S. By the way, perhaps you will agree to award me the "Duke Dollars" you are offering for this question that you also asked in the Java Developer Connection (JDC) forums?

  • Cmp transaction exception

    I am getting a sqlexception error message in the client(servlet) when my entity bean(cmp) performs the database operation.
    I am invoking the entity bean thru the session bean which is called by the servlet (client).
    I need my sqlexception to be delegated to my session bean instead of the client(servlet).
    let me know if u guys have any solution for this.
    i am using weblogic6.1 & oracle database.

    hello ravi,
    thanks for the answer.
    so u mean to tell that i have to catch sqlexception where i invoke the entity bean call right?
    i will try that.
    ok i have one more question to u.
    Assume that the client is getting the remote exception thrown by the container.
    when i do a exp.getMessage() on the client side i am getting a full printstacktrace.
    But i need just one single statement from the exception messages.
    so how u handle this?
    Thanks in advance.
    radhakrishnan.

  • Rollback CMP Transaction

    Hi
    I am checking for one object and if that is null i want to throw Application exception from my EJB. Now if i thorw application exception container does not rollback the data. We need to set ctx.setRollbackOnly.
    say i have method
    public void setData(ValueObject MyVO)
    if(MyVO!=null)
    // do something
    else
    ctx.setRollbackOnly()
    throw new myexception("Null obj VO");
    am i on the right track. I beleive this will allow me to throw application exception as well as rollback the transcation.
    I am using weblogic 7.0 with ejb2.0 and CMR relations. All my transactions attributes are set to Required
    Pranav

    Hey thanks for your input.
    But just a quick question for you.
    Can i create a application exception extends EJBException
    so that now when i thorw MyExp it will not have to call ctx.setRollbackOnly.
    Like this
    TestEJB.java
    public void setData(MyVO vo)
    if(vo==null)
    thorw new MyExp("Cannot be null");
    in this even if i dont call rollback on context still it will rollback cos now my exception is child of ejbexception(system exception)
    am i right
    which is the best way to do though.
    This one or one which i asked as first quesrtion
    thanks
    pranav

  • MDB Transaction

    Hi,
    I'm having some issues in same cases with MDB transactions on WL. I have an MDB deployed on a 9.2 WL defined as a CMP with auto-acknowledge in the EJB descriptor (using EJB 2.1 standards) which listens on a queue which is defined in the local WL JMS module and mapped to an external Tibco EMS queue.
    Used descriptor configuration :
    <messaging-type>javax.jms.MessageListener</messaging-type>
    <transaction-type>Container</transaction-type>
    <message-destination-type>javax.jms.Queue</message-destination-type>
    <activation-config>
    <activation-config-property>
    <activation-config-property-name>destinationType</activation-config-property-name>
    <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
    </activation-config-property>
    <activation-config-property>
    <activation-config-property-name>acknowledgeMode</activation-config-property-name>
    <activation-config-property-value>Auto-acknowledge</activation-config-property-value>
    </activation-config-property>
    </activation-config>
    The MDB processes the message, accesses a DB and sends it of the an external system. When no exception happened the MDB method finishes and normally the container acknowledges
    This all works great untill we put some load on the queue. Sometimes we note that a JMS message gets stuck in the input queue when lots of messages are being put on the input queue. We can trace that such messages actually were picked up by the MDB and processed to a certain extend.
    Sometimes the processing log trace just stops in the middle of processing. Sometimes the entire processing log trace is present. However the JMS messages are kept in the input queue and seem to locked (they can't be flushed out as long as the component is still running).
    It looks like the messages are awaiting acknowledgement from the WL container manager but somehow the transaction got lost and never got back to the external EMS to acknowledge the message in the input queue.
    I was wondering if there is a way to monitor CMP transactions or the status of the container manager? As far as I know the container manager always tries to contact the remote EMS server to acknowledge the message in this setup. What would happen if the remote EMS server would be overloaded and could not respond back to the WL container manager to confirm message acknowledgment?

    Thanks for the reply. There are no errors what so ever regarding MDB issues. Not in the weblogic / console logging, nor in the logging of the component itself.
    The MDB itself is setup to have 16 concurrent beans per component deployment. The component is clustered over 4 server instances. So there are quite some concurrent MDBs running. However since the messages get stuck for weeks eventhough the component only has bursts of messages to process, one would think that the the stuck messages would be processed whenever the component has some spare time (which it has a lot between the bursts).
    Therefor i doubt it has anything to do with too little MDBs running. But frankly I have no idea what's wrong.

  • Help needed - transaction atomicity did not happen

              Hi -
              We recently encountered a strange problem. Due to a bad search query in another
              application, our Oracle RDBMS was running our of SGA and causing transactions
              to fail.
              What makes us worry more is that we had transactions spanning 2 entity beans part
              committed and part rollbacked! The following scenario describes:
              In a single method XX within a Session Bean facade, we have
              call entity bean A to create (CMP, transaction REQUIRED)
              call entity bean B to create (CMP, transaction REQUIRED)
              .some logging info here at point 1
              From our debug log, the program cleary runs to point 1. And the data written
              by entity bean B was committed and found in database. But the one written by
              entity Bean A is NOT! There is an exception for rollback in the log.
              Q1. How does container commit work? Can an execution continue till the return
              of method XX before the container tries to commit and get an error?
              Q2. Also, why isn't the whole transaction rollbacked? What are we missing?
              We are using TxDataSource, and db driver is weblogic.jdbc.oci.Driver.
              Any help and pointer appreciated. Thanks!
              ph
              

    Sounds as if your session facade method XX does not open a transaction.
              Then you have two transactions, A and B, which can be rolled back or
              committed independent of each other.
              Try setting transaction required for the method XX.
              Also, in the entity beans, you can use
              weblogic.transaction.TxHelper.getTransaction().getName() or getXid() to
              find out if A and B use the same transaction or different ones.
              Philip
              Pow-hwee Tan wrote:
              > Hi -
              >
              > We recently encountered a strange problem. Due to a bad search query in another
              > application, our Oracle RDBMS was running our of SGA and causing transactions
              > to fail.
              >
              > What makes us worry more is that we had transactions spanning 2 entity beans part
              > committed and part rollbacked! The following scenario describes:
              >
              > In a single method XX within a Session Bean facade, we have
              >
              > call entity bean A to create (CMP, transaction REQUIRED)
              > call entity bean B to create (CMP, transaction REQUIRED)
              > .some logging info here at point 1
              >
              > From our debug log, the program cleary runs to point 1. And the data written
              > by entity bean B was committed and found in database. But the one written by
              > entity Bean A is NOT! There is an exception for rollback in the log.
              >
              > Q1. How does container commit work? Can an execution continue till the return
              > of method XX before the container tries to commit and get an error?
              >
              >
              > Q2. Also, why isn't the whole transaction rollbacked? What are we missing?
              >
              > We are using TxDataSource, and db driver is weblogic.jdbc.oci.Driver.
              >
              > Any help and pointer appreciated. Thanks!
              >
              > ph
              >
              

  • BPEL TRANSACTION ROLLBACK

    I've just tested the standart samples
    integration\orabpel\samples\demos\BankTransferDemo\BankTransferFlow\
    BankTransferFlow
    and
    BankTransferFlowWithCompensation
    Rollback was not executed. Why????????????????????????

    Ok i set set the env. var.
    OPATCH_QUOTE_PERL_CMD = TRUE
    ACTIVE_STATE_PERL = TRUE
    i find it in c:\OraBPELPM\OPatch\docs\FAQ
    so the result is changed but still gets error....
    can u advice me what i must to do now .....
    **************** commad line **********************
    C:\Documents and Settings\DoroshenkoOleg>c:\Perl\bin\perl5.6.1.exe C:\OraBPELPM\
    OPatch\opatch.pl apply c:\Install\Oracle\Bpel\patch\1\4343748
    Oracle Interim Patch Installer version 1.0.0.0.52
    Copyright (c) 2005 Oracle Corporation. All Rights Reserved..
    We recommend you refer to the OPatch documentation under
    OPatch/docs for usage reference. We also recommend using
    the latest OPatch version. For the latest OPatch version
    and other support related issues, please refer to document
    293369.1 which is viewable from metalink.oracle.com
    Oracle Home = c:\OraBPELPM
    Location of Oracle Universal Installer components = C:\OraBPELPM\oui
    Location of OraInstaller.jar = "C:\OraBPELPM\oui\jlib"
    Oracle Universal Installer shared library = C:\OraBPELPM\oui\lib\win32\oraInstal
    ler.dll
    Location of Oracle Inventory Pointer = N/A
    Location of Oracle Inventory = C:\OraBPELPM\inventory
    Path to Java = "C:\OraBPELPM\jdk\jre\bin\java.exe"
    Log file = c:\OraBPELPM/.patch_storage/<patch ID>/*.log
    Remove extra quote surrounding system commands on Windows...
    Remove extra quote surrounding system commands on Windows...
    Remove extra quote surrounding system commands on Windows...
    MISSING_COMPONENT : oracle.j2ee, 10.1.2.0.0
    This Oracle Home does not have components/versions required by the patch.
    ERROR: OPatch failed during pre-reqs check.
    **************** log file **********************
    Starting OPatch Apply session at 06-27-2006_12-13-23.
    Command arguments are: apply c:\Install\Oracle\Bpel\patch\1\4343748
    OPatch version is: 1.0.0.0.52
    Remove extra quote surrounding system commands on Windows...
    Performing RAC pre-req. check...
    Accessing inventory ... (retry 10 times, delay 30 seconds each time)
    System Command: "C:\OraBPELPM\jdk\jre\bin\java.exe" -Dopatch.retry=10 -Dopatch.delay=30 -classpath "C:\OraBPELPM\oui\jlib\OraInstaller.jar;C:\OraBPELPM\oui\jlib\srvm.jar;C:\OraBPELPM\OPatch\jlib\opatch.jar;C:\orabpelpm\oui\jlib\xmlparserv2.jar;C:\orabpelpm\oui\jlib\share.jar;C:\orabpelpm\jlib\srvm.jar" opatch/O2O "c:\orabpelpm" "C:\OraBPELPM\oui" opatch.pl 1.0.0.0.52
    Result:
    output to OPatch:
    NODE_LIST=NULL
    NODE_COUNT=0
    LOCAL_NODE=NULL
    IS_CFS=0
    RAC_CODE=0
    HOME_INDEX=2
    This is not a RAC system
    Interim Patch ID: 4343748
    Checking the patch inventory.
    Component Name: oracle.j2ee
    Component Version: 10.1.2.0.0
    Bugs fixed by this patch 4343748:
    4343748 : MPSE ON 10.1.2 FOR MLR BUGS 4338987 AND 4298949
    4167846 : CTX.LOOKUP(JAVA-COMP/ENV/EJB/EJBNAME); IN EJBCREATE METHOD
    4298949 : MLR ON 10.1.2 FOR BUGS 4212066,4043715,4021903,4135569,4167846,4186614,4113514
    4338987 : MLR ON 10.1.2 FOR BUGS 4043715, 4327193
    4327193 : STRESS BPEL-TRANSACTION BECOMES NULL CAUSING - CMT TRANSACTION ERROR
    4135569 : HTTPSESSION IS LOST DURING OCCASIONALLY DURING APPLICATION DEPLOYMENT
    4021903 : USER INTERFERENCE WITH CMP TRANSACTION (ILLEGAL TERMINATION OF TRANSACTION)
    4113514 : OC4J CONTAINER HANGS DURING RE-DEPLOYMENT
    4043715 : CALL TO SESSION BEAN FAILS WITH USER INTERFERENCE WITH CMP TRANSACTION ERROR
    4212066 : STRESS- RESTRICTS MAXIMUM CONCURRENT CONNECTIONS IN AJP LISTENER
    3562466 : PERF- MDB OC4J-JMS SINGLE-USER TEST SHOWS INCREASING ART OVER TIME
    Reading patch XML files and doing sanity checks.
    Read the command to action file map.
    Performing initial safety check.
    Checking active processes:
    Remove extra quote surrounding system commands on Windows...
    Accessing inventory ... (retry 10 times, delay 30 seconds each time)
    System Command: "C:\OraBPELPM\jdk\jre\bin\java.exe" -Dopatch.retry=10 -Dopatch.delay=30 -classpath "C:\OraBPELPM\oui\jlib\OraInstaller.jar;C:\OraBPELPM\oui\jlib\srvm.jar;C:\OraBPELPM\OPatch\jlib\opatch.jar;C:\orabpelpm\oui\jlib\xmlparserv2.jar;C:\orabpelpm\oui\jlib\share.jar" opatch/CheckConflict "C:\OraBPELPM\oui" "c:\orabpelpm" opatch.pl 1.0.0.0.52 4343748 "3562466 4212066 4043715 4113514 4021903 4135569 4327193 4338987 4298949 4167846 4343748 " C:\Install\Oracle\Bpel\patch\1\4343748\etc\config\actions
    Result:
    MISSING_COMPONENT : oracle.j2ee, 10.1.2.0.0
    MISSING_COMPONENT : oracle.j2ee, 10.1.2.0.0
    MISSING_COMPONENT : oracle.j2ee, 10.1.2.0.0
    This Oracle Home does not have components/versions required by the patch.
    ERROR: OPatch failed during pre-reqs check.
    *****************************************************************

  • NO EXCEPTION IS THROWN FROM THE PERSIST

    We are using Glassfish and MySQL. When we do a persist with a bad object/query, internal DB errors are NOT being reported back to the caller in any way, but Glassfish knows that the error occurred. Here is a schematic of the situation:
         Glassfish starts a CMP transaction and calls our bean
              Inside the bean we have code like this:
                   obj = (a new object that will cause a DB error when persisted)
                   try {
                        entityManager.persist(obj)
                   } catch (Throwable t) {
                        report to the user that the throwable happened
              bean returns
         Glassfish manages CMP transaction
    What we see is the following:
         - The persist has an internal failure and generates error messages in the Glassfish system.log file.
         - NO EXCEPTION IS THROWN FROM THE PERSIST, so the application code thinks that the persist completed correctly
         - At the end of the bean operation, Glassfish (correctly) rolls back the transaction.
    At the user level the result is that the request succeeds but nothing is put into the Database!
    We are not asking about the cause of the DB error. From reading the system log we know what happened and can fix it. Our problem is that problems in our field-deployed systems cannot be detected by the application code so failures cannot be reported to the user.
    The critical question is:
         Is there a way for the application code in the bean to see that an error occurred?
    By the way, we also have a secondary question: Why is the erroneous persist tried 6 times before deciding it won't work? Is there an option somewhere that says to try 6 times?
    The Exception as reported in the system log (only one copy of it) is included below.
    [#|2008-10-22T08:32:25.992-0400|WARNING|sun-appserver9.1|oracle.toplink.essentials.session.file:/opt/localVendors/glassfish/tems-glassfish-v1/domains/domain1/applications/j2ee-apps/im-app/im-ejb_jar/-local|_ThreadID=138;_ThreadName=p: thread-pool-1; w: 156;_RequestID=509e7043-21bb-410c-b795-19e9953afeec;|
    Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'STATIONCODE' cannot be null
    Error Code: 1048
    Call: INSERT INTO <exact operation and table contents elided from this trace file>
         at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:311)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:654)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:703)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:492)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:452)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeCall(AbstractSession.java:690)
         at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
         at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:214)
         at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:346)
         at oracle.toplink.essentials.internal.queryframework.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:191)
         at oracle.toplink.essentials.internal.queryframework.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:205)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:564)
         at oracle.toplink.essentials.queryframework.InsertObjectQuery.executeCommit(InsertObjectQuery.java:89)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.performUserDefinedWrite(DatabaseQueryMechanism.java:750)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.performUserDefinedInsert(DatabaseQueryMechanism.java:714)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.insertObjectForWriteWithChangeSet(DatabaseQueryMechanism.java:602)
         at oracle.toplink.essentials.queryframework.WriteObjectQuery.executeCommitWithChangeSet(WriteObjectQuery.java:162)
         at oracle.toplink.essentials.internal.queryframework.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:390)
         at oracle.toplink.essentials.queryframework.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:109)
         at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:628)
         at oracle.toplink.essentials.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:555)
         at oracle.toplink.essentials.queryframework.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:138)
         at oracle.toplink.essentials.queryframework.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:110)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2233)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:909)
         at oracle.toplink.essentials.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:269)
         at oracle.toplink.essentials.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:190)
         at oracle.toplink.essentials.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:2657)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1044)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:403)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1126)
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:2443)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.issueSQLbeforeCompletion(RepeatableWriteUnitOfWork.java:202)
         at oracle.toplink.essentials.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:131)
         at oracle.toplink.essentials.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:91)
         at com.sun.jts.jta.SynchronizationImpl.before_completion(SynchronizationImpl.java:99)
         at com.sun.jts.CosTransactions.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:158)
         at com.sun.jts.CosTransactions.TopCoordinator.beforeCompletion(TopCoordinator.java:2548)
         at com.sun.jts.CosTransactions.CoordinatorTerm.commit(CoordinatorTerm.java:278)
         at com.sun.jts.CosTransactions.TerminatorImpl.commit(TerminatorImpl.java:249)
         at com.sun.jts.CosTransactions.CurrentImpl.commit(CurrentImpl.java:623)
         at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:309)
         at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.commit(J2EETransactionManagerImpl.java:1030)
         at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:397)
         at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3792)
         at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
         at com.sun.ejb.containers.MessageBeanContainer.afterMessageDeliveryInternal(MessageBeanContainer.java:1226)
         at com.sun.ejb.containers.MessageBeanContainer.afterMessageDelivery(MessageBeanContainer.java:1197)
         at com.sun.ejb.containers.MessageBeanListenerImpl.afterMessageDelivery(MessageBeanListenerImpl.java:79)
         at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:139)
         at $Proxy364.afterDelivery(Unknown Source)
         at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:324)
         at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
    Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'STATIONCODE' cannot be null
         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
         at com.mysql.jdbc.jdbc2.optional.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:840)
         at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:647)
         ... 53 more
    |#]

    This is because the persistent context is not synchronized with the database until the commit is being executed.
    You might 'force' this by calling entityManager.flush() right after the call to persist(...).
    Or you register a transaction synchronizer and check the transaction status on afeterCompletion().
    - Roy

  • Opatch - MISSING_COMPONENT : oracle.j2ee, 10.1.2.0.0

    Hi,
    When I try to apply the various BPEL patches, the following error obscurs:
    Starting OPatch Apply session at 11-21-2005_08-02-55.
    Command arguments are: apply
    OPatch version is: 1.0.0.0.52
    Performing RAC pre-req. check...
    Accessing inventory ... (retry 10 times, delay 30 seconds each time)
    System Command: ""D:\oracle\bpel\jdk\jre\bin\java.exe" -Dopatch.retry=10 -Dopatch.delay=30 -classpath "D:\oracle\bpel\oui\jlib\OraInstaller.jar;D:\oracle\bpel\oui\jlib\srvm.jar;D:\Oracle\BPEL\OPatch\jlib\opatch.jar;D:\oracle\bpel\oui\jlib\xmlparserv2.jar;D:\oracle\bpel\oui\jlib\share.jar;D:\oracle\bpel\jlib\srvm.jar" opatch/O2O "d:\oracle\bpel" "D:\oracle\bpel\oui" opatch.pl 1.0.0.0.52"
    Result:
    output to OPatch:
    NODE_LIST=NULL
    NODE_COUNT=0
    LOCAL_NODE=NULL
    IS_CFS=0
    RAC_CODE=0
    HOME_INDEX=4
    This is not a RAC system
    Interim Patch ID: 4343748
    Checking the patch inventory.
    Component Name: oracle.j2ee
    Component Version: 10.1.2.0.0
    Bugs fixed by this patch 4343748:
    4343748 : MPSE ON 10.1.2 FOR MLR BUGS 4338987 AND 4298949
    4167846 : CTX.LOOKUP(JAVA-COMP/ENV/EJB/EJBNAME); IN EJBCREATE METHOD
    4298949 : MLR ON 10.1.2 FOR BUGS 4212066,4043715,4021903,4135569,4167846,4186614,4113514
    4338987 : MLR ON 10.1.2 FOR BUGS 4043715, 4327193
    4327193 : STRESS BPEL-TRANSACTION BECOMES NULL CAUSING - CMT TRANSACTION ERROR
    4135569 : HTTPSESSION IS LOST DURING OCCASIONALLY DURING APPLICATION DEPLOYMENT
    4021903 : USER INTERFERENCE WITH CMP TRANSACTION (ILLEGAL TERMINATION OF TRANSACTION)
    4113514 : OC4J CONTAINER HANGS DURING RE-DEPLOYMENT
    4043715 : CALL TO SESSION BEAN FAILS WITH USER INTERFERENCE WITH CMP TRANSACTION ERROR
    4212066 : STRESS- RESTRICTS MAXIMUM CONCURRENT CONNECTIONS IN AJP LISTENER
    3562466 : PERF- MDB OC4J-JMS SINGLE-USER TEST SHOWS INCREASING ART OVER TIME
    Reading patch XML files and doing sanity checks.
    Read the command to action file map.
    Performing initial safety check.
    Checking active processes:
    Accessing inventory ... (retry 10 times, delay 30 seconds each time)
    System Command: ""D:\oracle\bpel\jdk\jre\bin\java.exe" -Dopatch.retry=10 -Dopatch.delay=30 -classpath "D:\oracle\bpel\oui\jlib\OraInstaller.jar;D:\oracle\bpel\oui\jlib\srvm.jar;D:\Oracle\BPEL\OPatch\jlib\opatch.jar;D:\oracle\bpel\oui\jlib\xmlparserv2.jar;D:\oracle\bpel\oui\jlib\share.jar" opatch/CheckConflict "D:\oracle\bpel\oui" "d:\oracle\bpel" opatch.pl 1.0.0.0.52 4343748 "3562466 4212066 4043715 4113514 4021903 4135569 4327193 4338987 4298949 4167846 4343748 " D:\Oracle\BPEL\Patches\4343748\etc\config\actions"
    Result:
    [b]MISSING_COMPONENT : oracle.j2ee, 10.1.2.0.0
    MISSING_COMPONENT : oracle.j2ee, 10.1.2.0.0
    MISSING_COMPONENT : oracle.j2ee, 10.1.2.0.0
    This Oracle Home does not have components/versions required by the patch.
    ERROR: OPatch failed during pre-reqs check.
    I appreciate any help,
    Cyryl

    ERROR MISSING_COMPONENT oracle.j2ee, 10.1.3.4.0
    Hii,
    I m upgrading from 12.0.4 to 12.1.1, for that i have upgraded my OracleAS 10g from 10.1.3.0.0 to 10.1.3.4.0 and now applying the patch 6702510 it is showing the folloign error:
    MISSING_COMPONENT : oracle.j2ee, 10.1.3.4.0
    This Oracle Home does not have components/versions required by the patch.
    ERROR: OPatch failed during prerequisite check.
    can anyone help me in resolviing the problem..what should i do..??
    Thanks..

  • SQLException: XA error: XAResource.XAER_PROTO start() - weblogic 10.0.1.0

    Hello all,
    We are facing java.sql.SQLException: XA error: XAResource.XAER_PROTO start() in one of our EJB classes.
    It is only occurring intermittently! Probably during peak load time (not really sure).
    Our EJB uses CMP transactions and the EJB operation's trans-attribute is <trans-attribute>Supports</trans-attribute>.
    Google is showing similar experiences from users with wls8.1 versions. Has any one come across this error in wls 10? Any help is hugely appreciated.
    with Thanks
    Val
    * Error stacktrace & JDBC settings xml are below.
    Weblogic server version is: 10.0.1.0
    JDBC Driver version: 10.2.0.4
    Oracle Database version info:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
    NLSRTL Version 10.2.0.4.0 - Production
    Error StackTrace:_
    nested exception is javax.transaction.TransactionRolledbackException: EJB Exception: :
    javax.ejb.EJBException: Could not get JDBC Connection; nested exception is java.sql.SQLException:
    Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_PROTO start() failed on resource DatasourceTxD': XAER_PROTO : Routine was invoked in an inproper context oracle.jdbc.xa.OracleXAException
    JDBC datasource settings xml:_
    <jdbc-connection-pool-params>
    <initial-capacity>5</initial-capacity>
    <max-capacity>25</max-capacity>
    <capacity-increment>5</capacity-increment>
    <shrink-frequency-seconds>900</shrink-frequency-seconds>
    <connection-creation-retry-frequency-seconds>360</connection-creation-retry-frequency-seconds>
    <test-frequency-seconds>360</test-frequency-seconds>
    <test-connections-on-reserve>true</test-connections-on-reserve>
    <inactive-connection-timeout-seconds>600</inactive-connection-timeout-seconds>
    <test-table-name>SQL SELECT 1 FROM dual</test-table-name>
    <statement-cache-size>100</statement-cache-size>
    <seconds-to-trust-an-idle-pool-connection>360</seconds-to-trust-an-idle-pool-connection>
    </jdbc-connection-pool-params>
    <jdbc-data-source-params>
    <jndi-name>JNDI_NAME</jndi-name>
    <global-transactions-protocol>TwoPhaseCommit</global-transactions-protocol>
    </jdbc-data-source-params>
    <jdbc-xa-params>
    <keep-xa-conn-till-tx-complete>true</keep-xa-conn-till-tx-complete>
    <xa-end-only-once>true</xa-end-only-once>
    <xa-set-transaction-timeout>true</xa-set-transaction-timeout>
    <xa-transaction-timeout>120</xa-transaction-timeout>
    <xa-retry-duration-seconds>360</xa-retry-duration-seconds>
    </jdbc-xa-params>

    Thanks Joe, we will contact the official support.
    Edited by: user5380898 on Nov 1, 2010 11:20 AM

  • CMP and Transaction Attribute

    Hi All!
    I try to play with cmp entity beans. All I try to do is find instance and call one from the methods.
    When I use transaction attribute another than "Required", I get exception 25222. Application module creation exception.
    If I change attribute to "Required New" then I get error while bean try to UPDATE record.
    I can't understand why this update appear on findByPrimaryKey!
    Can any body give some information on JBO behavior?
    Mike
    null

    I do one more test and found
    UPDATE exception raised when I have foreign key in table. If I use only plain fild evething is ok. If add to entity foreign key field container raise exception when it try to update record.

  • How to use same transaction when calling CMP entity beans and  DAO (JDBC)

    We are currently using Weblogic 8.1 SP2 with an Oracle 10g database (using XA thin and non-XA drivers).
    We have a session bean that invokes an entity bean and a DAO (data access object pattern) in order to add data in 2 separate tables (account and history). Rows are added to the first (account) table using a CMP Entity bean while inserts are done in the 2nd (history) table using a DAO. Here is some pseudo code:
    addHistorySessionBean (trans-attribute="Required")
    begin
    Step #1 - call addAccountEntityBean (trans- attribute="Required")
    Step #2 - call addHistoryDAO (get datasource, connection)
    end
    The 2nd table (history) has a foreign key constraint to ensure that the corresponding key exists in the first (account) table. Unfortunately, DAO inserts on the 2nd (history) table fail with a foreign key constraint violation (INTEGRITY CONSTRAINT VIOLATION - PARENT KEY NOT FOUND!) since they cannot see the row added to the 1st (account) table in step #1 by the CMP entity bean.
    How does one ensure that all this is done in a single transaction ? It appears that the app server creates two seperate transactions (one for the session bean facade and the entity bean and a 2nd transaction (when we retrieve a connection using the same data source JNDI name) for the DAO.
    A post on server side suggested using a "<resource-ref>" in the session bean to tie the two potentially separate transactions together, but that does not work for us. However, I am not sure if we are doing that correctly. After we define the resource ref in the session facade bean, do we use the resource ref "name" attribute to lookup the datasource or do we still lookup the datasource by JNDI name ? Do we need to define the resource-ref tag in the entity bean also ?
    Does Weblogic allow using a single transaction for this type of a scenario ? How does one specify within Weblogic that the same transaction should be utilized by the entity bean and any subsequent DAOs?
    People have also suggested that we defer constraint checking until the transaction(s) are committed but that sounds like a work acount without addressing this issue. Would postponing the constraint checking in Oracle cause any additional overhead ?
    Any suggestions with specific examples or documentation on how to address this issue will be gratefully appreciated.

    Thanks for your suggestion. Unfortunately, this does not work since it appears that there are 2 separate transactions going on here. One, the original one initiated by the session bean and used by the entity bean and the other initiated by the DAO. Any other ideas appreciated.
    Hi,
    Try setting the delay-database-inserts tag to
    ejbCreate in RDBMS descriptor file.
    http://bernal/stage/wls/docs81/ejb/DDreference-cmp-jar
    .html#1113981
    vasanthi ramesh

  • How to Create and Remove CMP Entity with Toplink in same transaction??

    Hi, i have a problem to create and delete cmp intances with toplink.
    I create a entity bean and remove the same entity bean in the same transaction.
    ie. my method have this code:
    bean a = homeBean.create(pk);
    a.remove();
    bean a = homeBean.create(pk);
    this code throws a javax.ejb.DuplicateKeyException
    Toplink not remove CMP, execute the two calls of create first.
    What configure toplink to support this case ??
    Is this possible ??
    I Can't controling the transaction manualy i'm using CMP entity beans with CMT.
    tanks.
    Message was edited by:
    Carlos Lacerda

    BM,
    If you want to import the utils package into your code, then the location of the utils package has to be in your CLASSPATH. JDeveloper uses libraries to define a project's CLASSPATH.
    I'm not sure exactly what's going on here, but you might want to read the information about packages and class libraries in the online documentation. It's under:
    User Guides
    -> Working with JDeveloper
    -> Packages and Class Libraries
    Blaise

Maybe you are looking for