Once Again: Transaction is not rolled back...

Hi all,
I'm almost at the end of my project with Toplink. but I have to solve this transaction rollback problem. Here is my previous message. any comment is more than welcome.
The problem is this, I pass 2 objects to Toplink to update in database using activeUnitOfWork.shallowMergeClone() method.
one of the updates fails then I expect everything to be rolled back within the same unitofwork. but NOT. the other object is quite well updated in database even though they are merged in the same unit of work... please HELP...
here is the log :
UnitOfWork(31228)--JTS#beforeCompletion()
UnitOfWork(31228)--#executeQuery(WriteObjectQuery(com.vnu.publitec.axis.persistence.Parameters@7a0b))
UnitOfWork(31228)--Connection(31249)--UPDATE PARAMETERS SET PARAM_VALUE = '26' WHERE (PARAM_NAME = 'TEST_PARAMETER_2')
UnitOfWork(31228)--#reconnecting to external connection pool
UnitOfWork(31228)--#executeQuery(WriteObjectQuery(com.vnu.publitec.axis.persistence.Parameters@7a06))
UnitOfWork(31228)--Connection(31249)--UPDATE PARAMETERS SET PARAM_MAX_SIZE = 666666, PARAM_COMMENTS = 'updated by new axis...', PARAM_VALUE = '18' WHERE (PARAM_NAME = 'TEST_PARAMETER_1')
UnitOfWork(31228)--EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DatabaseException
EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-01438: value larger than specified precision allows for this column
INTERNAL EXCEPTION: java.sql.SQLException: ORA-01438: value larger than specified precision allows for this column
...... //some more message
UnitOfWork(31228)--JTS#afterCompletion()
UnitOfWork(31228)--release unit of work
ClientSession(31229)--client released
environment information is :
J2EE Server is Oracle9iAS (9.0.3.0.0) Containers for J2EE
and following is a piece of sessions.xml file related to external transaction controller settings :
<session-type>
<server-session/>
</session-type>
<login>
<datasource>java:comp/env/jdbc/xxx</datasource>
<uses-native-sql>true</uses-native-sql>
<uses-external-transaction-controller>true</uses-external-transaction-controller>
<uses-external-connection-pool>true</uses-external-connection-pool>
</login>
<external-transaction-controller-class>oracle.toplink.jts.oracle9i.Oracle9iJTSExternalTransactionController</external-transaction-controller-class>
thanks
Erdem.

Hi James,
As Erdem is not available, I am now taking care of the issue. The datasource name in session.xml refers to the one defined in OC4J data-sources.xml "ejb-location" attribute of "data-source" element. Below, I attach the relevant sections of both files
session.xml
<session>
<name>Axis_session</name>
<project-xml>AxisCDM.xml</project-xml>
<session-type>
<server-session/>
</session-type>
<login>
<datasource>java:comp/env/jdbc/AXIS_323DS</datasource>
<uses-native-sql>true</uses-native-sql>
<uses-external-transaction-controller>true</uses-external-transaction-controller>
<uses-external-connection-pool>true</uses-external-connection-pool>
</login>
<external-transaction-controller-class>oracle.toplink.jts.oracle9i.Oracle9iJTSExternalTransactionController</external-transaction-controller-class>
data-sources.xml:
<data-source     
class="com.evermind.sql.DriverManagerDataSource"
name="AXIS_323DS"
location="jdbc/AXIS_323CoreDS"
xa-location="jdbc/xa/AXIS_323XADS"
ejb-location="jdbc/AXIS_323DS"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="XXX"
password="XXX"
url="jdbc:oracle:oci8:@ddb"
inactivity-timeout="30"
connection-retry-interval="1"
/>
On the client we get the following exception:
com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: Error in transaction: EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DatabaseException
EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-01438: value larger than specified precision allows for this column
On the server, we have implemented SessionSynchronization to monitor the transaction. afterCompletion method gets a boolean value "true" indicating that the transaction was comitted.
Any database operation that was successful before the erroneous case was saved in DB.
Thanks,
Melih

Similar Messages

  • Transaction is not Rolling Back in Stateless Session Bean

              Hi,
              I am using UserTransaction in Stateless Session bean .
              Transaction is not rolling back.
              The following code is writen in stateless session bean. In UserTransaction i am
              calling Two methods of another stateless session bean.
              The problem is if doJob2() method fails, doJob1() method is rolling back. These
              two methods consist of SQL statement with different Connection Object from TXDataSource.And
              session bean(TestSession) is set to CMT, attribute as "Required".
              try{
              Context ictx=new InitialContext();
              TestHome home=(TestHome)ictx.lookup("TestSession");
                   utx = sessionCtx.getUserTransaction();
                   utx.begin();
              TestRemote remote=home.create();
                   remote.doJob1();
                   remote.doJob2();
                   utx.commit();
              }catch(Exception e)
                   try{
                   utx.rollback();
              }catch(Exception ex)
                   System.out.println("unable to rollback"+ex);
              if any SQL Exception as occured in doJob2(), its calling method utx.rollback()
              in catch block. but SQL statements executed thru. doJob1() are not rolling back.
              what might be the reason?
              thanks
              Ranganath
              

              Thanx Priscilla ,
              Transaction is working.
              ranganath
              "Priscilla Fung" <[email protected]> wrote:
              >
              >In your ejb-jar.xml, you should specify <transaction-type> element to
              >be "Container"
              >for container-managed transaction. If you specified it to be "Bean" for
              >bean-managed
              >transaction, EJB ontainer will suspend the caller's transaction before
              >starting
              >a new transaction for your doJobX() methods. Thus, doJob1()nd doJob2()
              >will be
              >executing in different transactions, and thus rolling back doJob2()'s
              >transaction
              >will have no effect on work done and committed in doJob1()'s transaction.
              >
              >Regards,
              >
              >Priscilla
              >
              >
              >"Ranganath" <[email protected]> wrote:
              >>
              >>
              >>
              >>I am sending config.xml,deployment descriptors, code snippet for TestSession.
              >>i
              >>am using weblogic6.0sp2.
              >>if you need any aditional info. please let me know.
              >>
              >>thanks
              >>ranganath
              >>
              >>EJB-JAR.xml
              >>
              >><?xml version="1.0"?>
              >>
              >><!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
              >JavaBeans
              >>1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
              >>
              >><ejb-jar>
              >>     <enterprise-beans>
              >>     <session>
              >>          <ejb-name>TestSession</ejb-name>
              >>          <home>com.apar.sslbridge.test.TestHome</home>
              >>          <remote>com.apar.sslbridge.test.TestRemote</remote>
              >>          <ejb-class>com.apar.sslbridge.test.TestBean</ejb-class>
              >>          <session-type>Stateless</session-type>
              >>          <transaction-type>Bean</transaction-type>
              >>          <resource-ref>
              >>     <res-ref-name>jdbc/oraclePool</res-ref-name>
              >>     <res-type>javax.sql.DataSource</res-type>
              >>     <res-auth>Container</res-auth>
              >>          </resource-ref>
              >>     </session>
              >>     </enterprise-beans>
              >>     <assembly-descriptor>
              >>     <container-transaction>
              >>          <method>
              >>          <ejb-name>TestSession</ejb-name>
              >>          <method-intf>Remote</method-intf>
              >>          <method-name>*</method-name>
              >>          </method>
              >>          <trans-attribute>Required</trans-attribute>
              >>     </container-transaction>
              >> </assembly-descriptor>
              >></ejb-jar>
              >>
              >>
              >>TestSession CODE:
              >>
              >>
              >>     public void doJob1() throws RemoteException
              >>     {
              >>     Statement st = null;
              >>     String query=null;
              >>     try{
              >>     con=getConnection();
              >>     st=con.createStatement();
              >>     query="insert into x values("+x+++")";
              >>     System.out.println(query);
              >>     int rec=st.executeUpdate(query);
              >>     }catch(SQLException sqle)
              >>     {
              >>     System.out.println("SQL Exception "+sqle);
              >> throw new RemoteException("RemoteException*****SQLError");
              >>     } catch (Exception e) {
              >>     System.out.println("Exception "+e);
              >> throw new RemoteException("RemoteException*****GenralError");
              >> }
              >>}
              >>
              >>
              >> public void doJob2()throws RemoteException
              >> {
              >> Connection con=null;
              >> Statement st = null;
              >> String query=null;
              >> try{
              >> con=getConnection();
              >> st=con.createStatement();
              >> query="insert into y values("+x+++")";
              >> System.out.println(query);
              >> int rec=st.executeUpdate(query);
              >> }catch(SQLException sqle)
              >> {
              >> System.out.println("SQL Exception "+sqle);
              >> throw new RemoteException("RemoteException*****SQLError");
              >> } catch (Exception e) {
              >> System.out.println("Exception "+e);
              >> throw new RemoteException("RemoteException*****GenralError");
              >>}
              >>}
              >>private Connection getConnection(){
              >>try {
              >>Connection con = StaticParams.POOL_DATASOURCE.getConnection();
              >>return con;
              >>     } catch(Exception e) {
              >>     System.out.println("TestBean.getConnection() Unable to get get pool
              >>connection
              >>" + e);
              >>     }
              >>}
              >>
              >>
              >>
              >>
              >>"Priscilla Fung" <[email protected]> wrote:
              >>>
              >>>It should work if you are using TxDataSource. Could you post your
              >config.xml,
              >>>deployment descriptors, code snippet for TestSession?
              >>>
              >>>Regards,
              >>>
              >>>Priscilla
              >>>
              >>>"Ranganath" <[email protected]> wrote:
              >>>>
              >>>>Hi,
              >>>>
              >>>> I am using UserTransaction in Stateless Session bean .
              >>>> Transaction is not rolling back.
              >>>>
              >>>>The following code is writen in stateless session bean. In UserTransaction
              >>>>i am
              >>>>calling Two methods of another stateless session bean.
              >>>> The problem is if doJob2() method fails, doJob1() method is rolling
              >>>> back. These
              >>>>two methods consist of SQL statement with different Connection Object
              >>>>from TXDataSource.And
              >>>>session bean(TestSession) is set to CMT, attribute as "Required".
              >>>>
              >>>> try{
              >>>> Context ictx=new InitialContext();
              >>>> TestHome home=(TestHome)ictx.lookup("TestSession");
              >>>>     utx = sessionCtx.getUserTransaction();
              >>>>     utx.begin();
              >>>> TestRemote remote=home.create();
              >>>>     remote.doJob1();
              >>>>     remote.doJob2();
              >>>>     utx.commit();
              >>>> }catch(Exception e)
              >>>> {
              >>>>     try{
              >>>>      utx.rollback();
              >>>> }catch(Exception ex)
              >>>> {
              >>>>     System.out.println("unable to rollback"+ex);
              >>>>     }
              >>>> }
              >>>>if any SQL Exception as occured in doJob2(), its calling method utx.rollback()
              >>>>in catch block. but SQL statements executed thru. doJob1() are not
              >>rolling
              >>>>back.
              >>>>what might be the reason?
              >>>>
              >>>>thanks
              >>>>Ranganath
              >>>
              >>
              >
              

  • Statement in Transaction Does Not Roll Back

    I have a group of MySQL statements in a method of a Java application.
    I include an SQL error in the last statement to test the rollback of the transaction.
    All the statements roll back, EXCEPT for the one detailed below.
    The MySQL table:
         CREATE TABLE Counter (
              number INT( 4 ) NOT NULL DEFAULT 0,
              account_id VARCHAR( 12 ) NOT NULL PRIMARY KEY
         ) ENGINE = InnoDB;I have run the staement as a PreparedStatement and a Statement:
    PreparedStatement:
         String updateCounterStr =
              " UPDATE Counter " +
                   " SET number = number + 1 " +
                   " WHERE account_id = ? "
         updateCounter = con.prepareStatement ( updateCounterStr );
              updateCounter.setString( 1, accountID );
              int uc = updateCounter.executeUpdate();     Statement:               
         Statement updateCounterStatement = con.createStatement();
              int updatecounter = updateCounterStatement.executeUpdate(
                   "UPDATE Counter SET number = number + 1 " +
                   "WHERE account_id = \'" + accountID + "\'"
              con.setAutoCommit( true );     //     ------------------------------------ Transaction ENDS
              updateCounterStatement.close();
    //               updateCounter.close();
              ... several more
              con.close();
         } catch(SQLException ex) {
              System.err.println("SQLException: " + ex.getMessage());
              if (con != null) {
                   try {
                        System.err.print("Transaction is being ");
                        System.err.println("rolled back");
                        con.rollback();     //     < ------------------------------------ con.rollback() HERE
                   } catch(SQLException excep) {
                        System.err.print("SQLException: ");
                        System.err.println(excep.getMessage());
    }     //     ---------------------------------------- END the methodIn both cases Counter is incremented, but does NOT roll back.
    The other statements in the transaction do roll back,
    I am using:
    mysql Ver 14.12 Distrib 5.0.18, for apple-darwin8.2.0 (powerpc) using readline 5.0
    on Mac OS X 10.4.x
    I would greatly appreciate a solution to this problem.
    Many thanks in advance

    I think autocommit is true by default. Also, it looks like your'e setting it to true, and then executing more SQL.
    Explicitly set it to false, and DON'T set it back to trueif there's any chance you're going to want to rollback after that.

  • Transaction Process not rolling back

    Hi Experts,
    I am testing the Transaction Process which uses a DB Adapter (which calls a procedure) to insert data into a table. There are 2 fileds in the table (employee id and employee name) and in this employee id is the primary key. In the same scope I invoke this DB Adapter PL twice and for the first invoke it went fine but for the second invoke it has thrown me a unique constraint exception (as again I am passing the same data). I am catching the exception with a catch all block which is working absolutely fine.
    The problem is in the table I am getting the data entry for the first invoke which should have roll backed as i am using the *'transaction=participate'* property and respective changes have been done in bpel.xml for supporting the transaction.
    There should be no entry in the table but yet I am getting it. Please help me.
    Where could I have gone wrong?????
    I am using BPEL-10.1.3.1 version.
    Thanks in advance.
    Cheers,
    Ankit
    Edited by: user11083689 on Apr 24, 2009 4:41 AM

    hi,
    There are two mechanisms to force a rollback from a BPEL process.
    Explicitly — throw a bpelx:rollback fault within your flow:
    <throw name="Throw" faultName="bpelx:rollback"/>
    Invoke a partner link that marks the JTA transaction for rollback only.
    For example, in Oracle SOA Suite for 10.1.3.1.0, if Oracle BPEL Process Manager invokes an Oracle Enterprise Service Bus (ESB) flow that in turn fails to call a Web service endpoint, the JTA transaction is marked for rollback. Since the Oracle ESB flow enlists its local transaction in the JTA transaction, a rollback on the JTA transaction impacts Oracle BPEL Process Manager's ability to dehydrate (as the JTA transaction is used by Oracle BPEL Process Manager for persistence).
    regards
    Rajesh

  • Transaction is not rolling back

    I have statefull session CMT bean and I have a method
    public void meth1() {
    try {
    dao1.method1(connection);
    dao2.method2(connection);
    } catch (SQLException ex) {
    sessioncontext.setRollbackOnly();
    throw (application exception);
    If dao2.method2 raises sqlexception then whatever happend in dao1.method1 is committed. I have "Required" as transaction attribute for this session method.
    Also I cannot raise system exception as this removes the session bean instance. We are using j2ee 1.2.
    How to rollback for application errors.
    Thanks in advance

    I've never used oracle, so I can't say what your setup should be, however...
    databases can have transactions and the syntax is different between databases, e.g.
    start {start the transaction}
    update table X .....
    rollback {rollback the transaction}
    should not update the database
    but if table X does not support transactions, you can't do this.
    I had this problem with mysql, where everything worked fine until I had an exception or called setRollbackOnly. Some stuff would rollback (ovbiously cached in the app server), but other stuff wouldn't.
    I configured the tables in mysql to support transactions and it all worked.

  • Container transaction NOT rolled back after a long period of time.

    Hi, I am using Weblogic 6.1SP5 on RedHat 7.1 and I have seen an unexpected
              behaviour with an MDB and I would like to know if there is any circumstance
              in which a transaction is not rolled back automatically by the container
              after the transaction timeout specified on MDB descriptor expired.
              The fact is I have seen a thread locked for 3 entire days without any
              exception being raised (the trans timeout was set to 900 seconds for
              debugging porpouses)
              Sadly I didn't thought on issuing a ps -ax and a netstat -np in order to see
              if there was any connection active for any of the JVM threads.
              As an aside note I had to throw a kill -9 to Weblogic's JVM in order to
              completely stop it because using the standard "stopWeblogic.sh" script it
              got stalled.
              The only unusual thing that I can think of the MDB is doing is opening a
              connection against a remote system via a socket.
              My question is. Is it possible that a thread locked on I/O (in this case a
              socket) to be out of control in terms of throwing at it a "Transaction
              rolled back exception"?
              I have modified my code in order to set SO_TIMEOUT on the socket just in
              case the other peer hangs and never returns control. But I would like to
              know the problem could be there.
              I know for sure that at the time the thread stalled the other peer died
              (exceptions on other MDBs trying to connect to remote system) but I expected
              a "socket exception" to be thrown by the O.S. to the stalled thread instead
              of having the thread waiting forever on that "open" socket.
              Thanks in advance.
              Ignacio.
              

    While a tramsaction may be rolled back at the transaction timeout,
              the thread is not stopped. The actual exception won't occur until
              the MDB completes. If the MDB doesn't complete (as in this case),
              you won't get the exception.
              "Ignacio G. Dupont" <[email protected]> wrote in message news:[email protected]...
              > Hi, I am using Weblogic 6.1SP5 on RedHat 7.1 and I have seen an unexpected
              > behaviour with an MDB and I would like to know if there is any circumstance
              > in which a transaction is not rolled back automatically by the container
              > after the transaction timeout specified on MDB descriptor expired.
              >
              > The fact is I have seen a thread locked for 3 entire days without any
              > exception being raised (the trans timeout was set to 900 seconds for
              > debugging porpouses)
              >
              > Sadly I didn't thought on issuing a ps -ax and a netstat -np in order to see
              > if there was any connection active for any of the JVM threads.
              >
              > As an aside note I had to throw a kill -9 to Weblogic's JVM in order to
              > completely stop it because using the standard "stopWeblogic.sh" script it
              > got stalled.
              >
              > The only unusual thing that I can think of the MDB is doing is opening a
              > connection against a remote system via a socket.
              >
              > My question is. Is it possible that a thread locked on I/O (in this case a
              > socket) to be out of control in terms of throwing at it a "Transaction
              > rolled back exception"?
              >
              > I have modified my code in order to set SO_TIMEOUT on the socket just in
              > case the other peer hangs and never returns control. But I would like to
              > know the problem could be there.
              >
              > I know for sure that at the time the thread stalled the other peer died
              > (exceptions on other MDBs trying to connect to remote system) but I expected
              > a "socket exception" to be thrown by the O.S. to the stalled thread instead
              > of having the thread waiting forever on that "open" socket.
              >
              > Thanks in advance.
              >
              > Ignacio.
              >
              >
              

  • Transaction not rolling back in stateless session bean

              Hi,
              I am facing a problem...
              I have one stateless session bean which does multiple updates in SYBASE database.I
              am using non-transactional datasource. Bean calls a method of data access obejct
              whcih internally calls more than one one mehtod to update different tables.If
              any of update fails then I am explicitly thorwing EJBException. Still it is not
              rolling back.
              I have one more application where similar situation is there but only difference
              is that there we have Entity bean and updates are being done through store method.
              In that case with same datasource it is rolling back perfectly.
              I have tried with transactional datasource as well but it didn't work.Then I tried
              to put setAutoCommit(false) in my connection class which gives me connection.But
              then it is not allowing me to enter into my application.
              In deployment descriptor for both the beans transaction attribute is required
              for all methods.
              Regards.
              Rahul.
              

              Hi,
              I am facing a problem...
              I have one stateless session bean which does multiple updates in SYBASE database.I
              am using non-transactional datasource. Bean calls a method of data access obejct
              whcih internally calls more than one one mehtod to update different tables.If
              any of update fails then I am explicitly thorwing EJBException. Still it is not
              rolling back.
              I have one more application where similar situation is there but only difference
              is that there we have Entity bean and updates are being done through store method.
              In that case with same datasource it is rolling back perfectly.
              I have tried with transactional datasource as well but it didn't work.Then I tried
              to put setAutoCommit(false) in my connection class which gives me connection.But
              then it is not allowing me to enter into my application.
              In deployment descriptor for both the beans transaction attribute is required
              for all methods.
              Regards.
              Rahul.
              

  • Stateless SessionBean  Transaction not Rolling Back

    I have a situation to create two Entity Beans within a single Transaction,
              so I created a Session Bean to create the two Entity Beans.
              I have the Session bean with attribute
              <session-type>Stateless</session-type>
              <transaction-type>Container</transaction-type>
              And 2 Entity beans with attributes:
              <persistence-type>Container</persistence-type>
              <trans-attribute>Required</trans-attribute>
              Inside the Session Bean I have a method which calls the create on the two
              Entity Beans.
              create ContactInfo(){
              Phone ph = phoneHome.Create(phoneData);
              Address ad = addressHome.Create(addressData);
              When the secound bean fails to create (Key voilation), my transaction is not
              getting rolled back.
              The Phone Create did not roll back eventhough the address create failed.
              Please give me some suggetion which transaction attributes to use
              I am using Weblogic 6.0
              

    For Create Exceptions , the transactions may or may not rollback. Mostly it
              wont rollback. You have to set the sessionctx.setRollbackOnly() to mark it
              for rollback in the catch block of the Create Exception.
              Regards,
              Swaminathan K.N.
              santo comar <[email protected]> wrote in message
              news:3b8dbb61$[email protected]..
              > I have a situation to create two Entity Beans within a single Transaction,
              > so I created a Session Bean to create the two Entity Beans.
              >
              > I have the Session bean with attribute
              >
              > <session-type>Stateless</session-type>
              > <transaction-type>Container</transaction-type>
              >
              > And 2 Entity beans with attributes:
              >
              > <persistence-type>Container</persistence-type>
              > <trans-attribute>Required</trans-attribute>
              >
              > Inside the Session Bean I have a method which calls the create on the two
              > Entity Beans.
              >
              > create ContactInfo(){
              > Phone ph = phoneHome.Create(phoneData);
              > Address ad = addressHome.Create(addressData);
              > }
              >
              > When the secound bean fails to create (Key voilation), my transaction is
              not
              > getting rolled back.
              > The Phone Create did not roll back eventhough the address create failed.
              > Please give me some suggetion which transaction attributes to use
              >
              > I am using Weblogic 6.0
              >
              >
              >
              

  • Toplink 9.0.4.8 and JTS on OAS 10.1.2.0.0 and 10.1.2.0.2 not rolling back t

    Toplink 9.0.4.8 and JTS not rolling back transaction
    Hi
    Scenario:
    I have a session bean (EJB1) calling a session bean (EJB2).
    When an EJB1 is called, EJB1 persists data on to Table1 in database.
    And EJB1 makes multiple calls to EJB2 to create entries in three different tables. Trans-attribute is set as required on both EJBS.
    Problem:
    EJB1 gets a Runtime Exception while inserting the data into TABLE1 (ORA-12899: value too large for column), EJB1 transaction is rollback, but all other transactions related to EJB2 are getting committed. I assume that they should roll back too.
    Also, I did JAD on external transaction controller and listener and noticed that there is a transaction associated to each call. Meaning EJB1 had Transaction T1 and EJB2 had T2, T3, and T4 for the subsequent calls. When EJB1 is getting runtime exception in the method beforeCompletion(), the it calls rollbackGlobalTransaction() which is calling T1.setRollbackonly(). But not on on T2, T3, and T4 rollback
    Am I missing anything?
    Please help me
    Here are my configuration details:
    The datasource configuration:
    <data-source name="myTxDataSource"
    class="com.evermind.sql.OrionCMTDataSource"
    location="jdbc/myTxDataSourceCoreDS"
    xa-location="jdbc/xa/myTxDataSourceXADS"
    ejb-location="jdbc/myTxDataSourceDS"
    pooled-location="jdbc/myTxDataSourcePooledDS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="duser"
    password="d123"
    url="jdbc:oracle:thin:@localhost:1521:ORCL"
    inactivity-timeout="30"
    />
    Sessions.xml
    <login>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <connection-url>jdbc:oracle:thin:@localhost:1521:orcl</connection-url>
    <datasource>jdbc/DimpleTxDataSourceCoreDS</datasource>
    <user-name>duser</user-name>
    <encryption-class-name>oracle.toplink.internal.security.JCEEncryptor</encryption-class-name>
    <encrypted-password>22F7AFE6F6B9672435537CE1189E123DD62D1A19DF561D1E</encrypted-password>
    <uses-native-sequencing>true</uses-native-sequencing>
    <uses-external-connection-pool>true</uses-external-connection-pool>
    <uses-external-transaction-controller>true</uses-external-transaction-controller>
    </login>
    <external-transaction-controller-class>oracle.toplink.jts.oracle9i.Oracle9iJTSExternalTransactionController</external-transaction-controller-class>
    Toplink Helper class that is used by both EJB's
    This one uses SessionBroker. here is how it is initialized:
    SessionManager manager = SessionManager.getManager();
    sessionBroker = (SessionBroker) manager.getSession(xmlLoader,
    sessionBrokerName, this.getClass().getClassLoader());
    Oracle9iJTSExternalTransactionController extController = new Oracle9iJTSExternalTransactionController();
    sessionBroker.setExternalTransactionController(extController);
    It has common following commong methods:
    public UnitOfWork getUnitOfWork() {
    UnitOfWork uow = sessionBroker.getActiveUnitOfWork();
    return uow;
    public Object create(Object o)
    UnitOfWork uow = getUnitOfWork();
    uow.registerNewObject(o);
    // added so that the assigned sequence number will be available before the commit happens
    uow.assignSequenceNumber(o);
    return o;
    }

    Doug, Andrei and others
    I found the problem. I have a Delegate that provides access to all EJBS. This delegate is used by both the webtier and middle tier.It is written in a generic fashion so that the web server and middle tier does not have to be co-located in one container. getInitialContext() which is implemented as follows:
    private static Context getInitialContext() throws NamingException
    // Get InitialContext for Embedded OC4J.
    // The embedded server must be running for lookups to succeed.
    // actual code reads from the external parameters
    String contextFactory = "com.evermind.server.rmi.RMIInitialContextFactory";
    String principal = "admin";
    String passwd = "admin123";
    String providerURL = "ormi://localhost:3201/shc";
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
    env.put(Context.SECURITY_PRINCIPAL, principal);
    env.put(Context.SECURITY_CREDENTIALS, passwd);
    env.put(Context.PROVIDER_URL, providerURL);
    env.put("dedicated.rmicontext","true");
    return new InitialContext(env);
    When the EJB1 tries to look up for EJB2, container thinks that the call is from outside the container and it is starting a new transaction.
    When I changed the EJB1 to look up EJB2 to get the context as shown below,every thing seems to rolling back.
    private static Context getInitialContext() throws NamingException
    return new InitialContext();
    Thanks again for pointing me in the right direction.
    I will post the same message in other threads.
    Raju

  • Transaction - the subprocess rolling back parent JTA

    According to Oracle documentation,
    "if the caller partner link specifies transaction=participate and the subprocess also specifies transaction=participate, the subprocess rolls back the client JTA transaction."
    But what I experience is if I just set transaction=participate for the partner link alone (and not having transaction=participate in the subprocess), when the subprocess rolls back, it rolls back parent JTA transaction also.
    In fact, if we have just transaction=participate for the partner link (and not having transaction=participate in the subprocess), then the rollback in either Parent or Subprocess, is rolling back both Parent and Subprocess.
    Can somebody provide the exact usage of using transaction=participate at the subprocess level?
    Thanks,
    Joe

    Joe,
    You are seeing expected behaviour. Even though both flags are called "transaction" and both are set to "participate", they do different things.
    By specifying transaction=participate on the partner link, you are instructing the subprocess to enlist in the transaction. When the subprocess starts, it will then enlist itself. That's all. Now if a rollback occurs, all participating processes will be rolled back.
    If you specify transaction=participate at the process level, it has a different effect, and doesn't affect whether or not the transaction is rolled back or not. As I said in the previous paragraph, if the partner link specified transaction=participate, the subprocess will roll back if a rollback is issued, no matter what other settings you have.
    So what effect does that setting have at the process level? According to the doc:
    When transaction=participate, the process produces a fault that is not handled by fault handlers, which calls the transaction to be rolled back.
    This is not exactly crystal clear, to me, anyway. In practice if this is set and your subprocess throws an unhandled fault, it triggers a rollback instead of throwing a fault as it normally would. This exception goes immediately back to the calling process since it is participating on the transaction as well.
    If the property is not set, and the subprocess throws an unhandled fault, you get the normal behavior. Namely, the process will be flagged as faulted, and the calling process will wait until it gets a transaction timeout (no relation to the JTA transaction we're talking about here).
    It's a simple test. Create two processes, then run it twice. Once with that property set, and one without.
    The key is to remember that although they are both called "transaction=participate", the effect they have is very different. It was probably not a good move to use the same name and value like that. Hope this helps.
    Regards,
    Robin.

  • MDB transaction getting silently rolled back?

              I have an MDB that is doing a delete of a database record in the onMessage method.
              It seems to work fine. I see no errors in the log, in fact I have some debug
              statements that indicate everything was completed normally. I even do a count
              sql using the same where clause and print the results and see a '0'.
              However, when I check the database, the record is still there.
              It seems as if the transaction is getting rolled back somehow. The MDB is transaction
              required/container tx. I never setRollbackOnly anywhere.
              The topic was originally published in a transaction that was rolled back, if that
              makes any difference. In fact, the point of the MDB is to clean up a record that
              was created during the transaction but not within the transaction.
              Any help is appreciated!
              ken
              

              It turned out that the MDB was using a different connection pool than it should
              have, which was pointed to an old copy of the database. So it wasn't really rolling
              back, it really was deleting records as desired, just in the wrong database.
              Thanks
              ken
              Tom Barnes <[email protected].bea.com>
              wrote:
              >Some random ideas:
              >
              >Is the app sending a delete request to the MDB, and
              >the MDB acting on it, before the record is even inserted?
              >
              >Does the delete request have the correct row-id/PK?
              >
              >Is the MDB app failing without your knowledge? You
              >can instrument the MDB onMessage() with a
              >"try catch Throwable" to see.
              >
              >Is the MDB tx timing out trying to get a lock
              >on the row? You can instrument the onMessage
              >with timestamps to see if its taking longer than 30 seconds...
              >
              >Tom
              >
              >Ken Clark wrote:
              >
              >> I have an MDB that is doing a delete of a database record in the onMessage
              >method.
              >> It seems to work fine. I see no errors in the log, in fact I have
              >some debug
              >> statements that indicate everything was completed normally. I even
              >do a count
              >> sql using the same where clause and print the results and see a '0'.
              >>
              >> However, when I check the database, the record is still there.
              >>
              >> It seems as if the transaction is getting rolled back somehow. The
              >MDB is transaction
              >> required/container tx. I never setRollbackOnly anywhere.
              >>
              >> The topic was originally published in a transaction that was rolled
              >back, if that
              >> makes any difference. In fact, the point of the MDB is to clean up
              >a record that
              >> was created during the transaction but not within the transaction.
              >>
              >> Any help is appreciated!
              >>
              >> ken
              >
              

  • Toplink 9.0.4.8 and JTS on OAS 10.1.2.0.0 and 10.1.2.0.2 not rolling back

    Re-Posting message with more information.
    Toplink 9.0.4.8 and JTS not rolling back transaction
    Hi
    Scenario:
    I have a session bean (EJB1) calling a session bean (EJB2).
    When an EJB1 is called, EJB1 persists data on to Table1 in database.
    And EJB1 makes multiple calls to EJB2 to create entries in three different tables. Trans-attribute is set as required on both EJBS.
    Problem:
    EJB1 gets a Runtime Exception while inserting the data into TABLE1 (ORA-12899: value too large for column), EJB1 transaction is rollback, but all other transactions related to EJB2 are getting committed. I assume that they should roll back too.
    Also, I did JAD on external transaction controller and listener and noticed that there is a transaction associated to each call. Meaning EJB1 had Transaction T1 and EJB2 had T2, T3, and T4 for the subsequent calls. When EJB1 is getting runtime exception in the method beforeCompletion(), the it calls rollbackGlobalTransaction() which is calling T1.setRollbackonly(). But not on on T2, T3, and T4 rollback
    Am I missing anything?
    Please help me
    Here are my configuration details:
    The datasource configuration:
    <data-source name="myTxDataSource"
    class="com.evermind.sql.OrionCMTDataSource"
    location="jdbc/myTxDataSourceCoreDS"
    xa-location="jdbc/xa/myTxDataSourceXADS"
    ejb-location="jdbc/myTxDataSourceDS"
    pooled-location="jdbc/myTxDataSourcePooledDS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="duser"
    password="d123"
    url="jdbc:oracle:thin:@localhost:1521:ORCL"
    inactivity-timeout="30"
    />
    Sessions.xml
    <login>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <connection-url>jdbc:oracle:thin:@localhost:1521:orcl</connection-url>
    <datasource>jdbc/DimpleTxDataSourceCoreDS</datasource>
    <user-name>duser</user-name>
    <encryption-class-name>oracle.toplink.internal.security.JCEEncryptor</encryption-class-name>
    <encrypted-password>22F7AFE6F6B9672435537CE1189E123DD62D1A19DF561D1E</encrypted-password>
    <uses-native-sequencing>true</uses-native-sequencing>
    <uses-external-connection-pool>true</uses-external-connection-pool>
    <uses-external-transaction-controller>true</uses-external-transaction-controller>
    </login>
    <external-transaction-controller-class>oracle.toplink.jts.oracle9i.Oracle9iJTSExternalTransactionController</external-transaction-controller-class>
    Toplink Helper class that is used by both EJB's
    This one uses SessionBroker. here is how it is initialized:
    SessionManager manager = SessionManager.getManager();
    sessionBroker = (SessionBroker) manager.getSession(xmlLoader,
    sessionBrokerName, this.getClass().getClassLoader());
    Oracle9iJTSExternalTransactionController extController = new Oracle9iJTSExternalTransactionController();
    sessionBroker.setExternalTransactionController(extController);
    It has common following commong methods:
    public UnitOfWork getUnitOfWork() {
    UnitOfWork uow = sessionBroker.getActiveUnitOfWork();
    return uow;
    public Object create(Object o)
    UnitOfWork uow = getUnitOfWork();
    uow.registerNewObject(o);
    // added so that the assigned sequence number will be available before the commit happens
    uow.assignSequenceNumber(o);
    return o;
    }

    A couple of this appear different in your sessions.xml. To do what you want you need to configure TopLink to:
    1. Use an external XT controller - requires flag to be set and controller provided
    2. Use the OC4J data source - requires flag to be set and data source name provided
    I notice that your sessions.xml has both a data source name as well as a direct connection URL.
    Here is a sample that shows the proper settings for the external TX and data source usage:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!DOCTYPE toplink-configuration PUBLIC "-//Oracle Corp.//DTD TopLink Sessions 9.0.4//EN" "sessions_9_0_4.dtd">
    <toplink-configuration>
       <session>
          <name>default</name>
          <project-xml>META-INF/tlMap1.xml</project-xml>
          <session-type>
             <server-session/>
          </session-type>
          <login>
             <datasource>jdbc/DimpleTxDataSourceCoreDS</datasource>
             <platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</platform-class>
             <uses-external-connection-pool>true</uses-external-connection-pool>
             <uses-external-transaction-controller>true</uses-external-transaction-controller>
          </login>
          <external-transaction-controller-class>oracle.toplink.jts.oracle9i.Oracle9iJTSExternalTransactionController</external-transaction-controller-class>
          <enable-logging>true</enable-logging>
          <logging-options>
             <print-thread>false</print-thread>
             <print-date>false</print-date>
          </logging-options>
       </session>
    </toplink-configuration>Doug

  • ORA-06519: active autonomous transaction detected and rolled back

    I am getting this error. when i am doing insert from my package Any solution to reslove this issue
    ORA-06519: active autonomous transaction detected and rolled back . thanks
    I am doing select - insert...

    Also, if you have any exception handler sections in the code,
    then you have to add a commit or rollback statement for
    every exception that is handled.

  • HT201210 once again my iphone not working. i have a usb sign pointing to an itune icon on the screen. this is been on for over 24 hours. tried to restore but keeps coming up with era can anyone help please

    once again my iphone not working. i have a usb sign pointing to an itune icon on the screen. this is been on for over 24 hours. tried to restore but keeps coming up with era can anyone help please

    What is the error that is occurring?  We are not mind readers.

  • My iphone 4s in unlocked and i am currently using it for tmobile prepaid service. i want to restore the 7.0 settings back to 6.1.3 .. will this lock my iphone 4s once again after i restore it back to 6.1.3?

    My iphone 4s in unlocked and i am currently using it for tmobile prepaid service. i want to restore the 7.0 settings back to 6.1.3 .. will this lock my iphone 4s once again after i restore it back to 6.1.3?

    Because GPS has nothing to do with WiFi, cellular signals, or data of any sort. GPS is implemented by signals sent by satellites that are received by GPS receivers. The receivers process the information from the GPS satellites and calculate your location. GPS never sends data anywhere; GPS functionality is receive only.
    If you have WiFi or cellular data turned on this can improve the accuracy of GPS, because the GPS receiver can then use the known location of cell towers and WiFi networks to refine the GPS location. GPS by itself has an accuracy of 10 meters, or about 34 feet. Using the additional information from WiFi and cellular data this can be brought down to 3 meters (10 feet). This mode is called Augmented GPS, or A-GPS.

Maybe you are looking for

  • Trouble connecting AE to my laptop for stereo use

    I have a Dell laptop which connects wirelessly to my wireless dsl. I bought the Airport Express to be able to play ITunes wirelessly through my stereo. I assume that means I don't need to bother with my normal internet connection. But at first, my co

  • Canvas content is not visible

    Hi, I am adding canvas to a custom actionscript component which extends UIComponent. The canvas is created but it is not visible.The depth of the canvas is also shown.How to get it visible. Any help is appreciated. Thanks Srinivas

  • Changing Cost Center / Profit Center asignment to a different group

    Hi I want to change the assignment of some of our cost Centers to different groups in the hierarchy.  I know that the data already posted to CC/PC moves to the new group for reporting.  I just wanted to take another opinion if anyone of you had done

  • Show/Hide Address Bar

    The shortcut is Apple-|. What is the key???

  • Xml Utilities And Demos For Pl/Sql

    Is there any documentation on how to define reports and template through Designer? There are lots of information on Forms but what about Reports?! null