JTA succeeds, database rolls back?

Hi All,
     I am using a stateless session bean (EJB) to interact with eight
stored procedures under a container managed transaction. The issue is
the database is rolling back but not reporting it's error to the JTA.
The result, the application informs the user that the operation was
successful and the database does not record the data.
Side notes:
1. The public method called on the EJB is not set to be transactional
, a private method which is called by the public method is.
2. The transaction level of the private method on the EJB is set to
"REQUIRED"
3. The database rollback happens sporadically the majority of the
transactions write data to the database successfully
4. I am having difficulty reproducing the rollback in test
5. During testing I am forcing the transaction to fail by changing
stored procedures, and changing row level permission. Both worked
fine. The stored procedure throws an exception which triggers the JTA
and reported a error back to the user.
6.     Stored procedures are not explicitly calling RAISE EXCEPTION
My guess is it has something to do with SQL Server and its
communication with the JTA. Ether on the JTA level, JDBC Driver Level
or the SQL server itself.
Environment: WebLogic 6.1, MS SQL Server 7, Type 4 WebLogic SQL Server
7 JDBC Drivers, all Running on windows NT 4.0
     Any help would be greatly appreciated
     Thanks in advance
     James Nordstrom

Hi Cameron,
“Do your sp's rollback or commit or manipulate @@trancount in any way
including setting savepoints etc. ???          We are seeing a lot of “if(@@transcount > 0) rollack
transaction set implicit_transactions off WebLogic JDBC Driver”
     According to our DBA the stored procedure do not handle the
transaction, so they do not have an explicit rollback or commit or
manipulate status, please correct us if we are wrong.
     Could you please clarify the term “savepoints “ then I
can speak intelligently to the DBA.
     Thanks in advance.
     James Nordstrom
"Cameron Purdy" <[email protected]> wrote in message news:<[email protected]>...
Do your sp's rollback or commit or manipulate @@trancount in any way
including setting savepoints etc. ???
Peace,
Cameron Purdy
Tangosol Inc.
<< Tangosol Server: How Weblogic applications are customized >>
<< Download now from http://www.tangosol.com/download.jsp >>
"James Nordstrom" <[email protected]> wrote in message
news:[email protected]...
Hi All,
I am using a stateless session bean (EJB) to interact with eight
stored procedures under a container managed transaction. The issue is
the database is rolling back but not reporting it's error to the JTA.
The result, the application informs the user that the operation was
successful and the database does not record the data.
Side notes:
1. The public method called on the EJB is not set to be transactional
, a private method which is called by the public method is.
2. The transaction level of the private method on the EJB is set to
"REQUIRED"
3. The database rollback happens sporadically the majority of the
transactions write data to the database successfully
4. I am having difficulty reproducing the rollback in test
5. During testing I am forcing the transaction to fail by changing
stored procedures, and changing row level permission. Both worked
fine. The stored procedure throws an exception which triggers the JTA
and reported a error back to the user.
6. Stored procedures are not explicitly calling RAISE EXCEPTION
My guess is it has something to do with SQL Server and its
communication with the JTA. Ether on the JTA level, JDBC Driver Level
or the SQL server itself.
Environment: WebLogic 6.1, MS SQL Server 7, Type 4 WebLogic SQL Server
7 JDBC Drivers, all Running on windows NT 4.0
Any help would be greatly appreciated
Thanks in advance
James Nordstrom

Similar Messages

  • JTA transaction unexpectedly rolled back

    I have a Spring Java web app deployed on OC4J 10.1.3.3 using Toplink as the container managed persistence. When my app is launched a named query is executed that uses JPQL to load up collections of objects. It is failing with the subject line exception.
    org.springframework.transaction.UnexpectedRollbackException: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException: Timed out
    If, however, I then modify the URL and force an action that will re-execute the same query, it works fine.
    Any ideas on which configuration settings I should investigage/change to enable this to work the first time through?
    I am not dealing with large collections here. At this point, there are 11 main objects that have children/parents. Re-execution of the query happens very fast.
    Thank you!
    Ginni

    Hello,
    It sounds like its not the query itself that is taking too long, but all the processing done before the query in the same transaction scope. The error is that the transaction is timing out, so you should start by checking when the transaction is started and if the timeout value needs to be increased to cover the time this process is taking, or if the transaction can be made smaller or broken up into smaller peices. Or, if the query is just returning data that isn't going to be modified, if a transaction is required at all.
    Best Regards,
    Chris

  • Dbma_scheduler job executing procedure that loops through all client schemas in the database rolls back transaction incase of exception

    Hi,
    Needed your inputs on approach to implement a job using dbms_scheduler.
    We have around 2000 schemas. Each schema has a package with 2 procedures.
    The requirement is to create a single job in SYS that would loop through each schema and run the procedures at a specific time ( once a day) and send email notification on success or failure.
    Job script:
    BEGIN
        dbms_scheduler.create_job( job_name=> 'LOAD_EACH_SCHEMA_AUDIT_DATA',
                                   job_type=>'PLSQL_BLOCK',
                                   job_action=>'BEGIN  sys.p_loadaudit;     
                                    END;',
                                   start_date=>systimestamp,
                                   repeat_interval=>'FREQ=MINUTELY;INTERVAL=1',
                                   number_of_arguments=>0,
                                   enabled=> true,
                                   comments=>'Job repeat interval is every 5 mins' );
                                   END;
    Note: for testing purpose i have set repeat interval to minutely.
    Procedure job will be executing:
    Procedure sys.p_loadaudit:
    CREATE OR REPLACE
    PROCEDURE p_loadaudit
    AS
        v_count          NUMBER:= 0;
        lv_error_message VARCHAR2(4000);
        vstmt            VARCHAR2(4000);
    BEGIN
        FOR i IN
        ( SELECT username FROM dba_users WHERE username LIKE 'ABCFIRM%'
        LOOP
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_coa; end;';
            EXECUTE immediate vstmt;
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_am; end;';
            EXECUTE immediate vstmt;
        END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
        lv_error_message := 'Error in procedure p_loadaudit: ' || SQLCODE || ' -ERROR- ' || SUBSTR(
        sqlerrm,1,300) || '*' || dbms_utility.format_error_backtrace;
        raise_application_error(-20002,lv_error_message);
    END p_loadaudit;
    Example of one schema: SCHEMA_01
    create or replace
    PACKAGE pkg_audit_info
    AS
    type cursortype
    IS
        ref
        CURSOR;
            PROCEDURE p_load_COA;
            PROCEDURE p_load_AM;
       END pkg_audit_info;
    create or replace
    PACKAGE body pkg_audit_info
    AS
    PROCEDURE p_load_COA
    AS
    BEGIN
    INSERT INTO TABLE1();
    EXCEPTION
    WHEN OTHERS THEN
        lv_error_message := 'Error in procedure pkg_audit_info.p_load_COA: ' || SQLCODE
        || ' -ERROR- ' || SUBSTR(SQLERRM,1,300) || '*' || dbms_utility.format_error_backtrace;
        RAISE_application_error(-20002,lv_error_message);
    END p_load_COA;
    PROCEDURE p_load_AM
    AS
    BEGIN
    INSERT INTO TABLE2();
    EXCEPTION
    WHEN OTHERS THEN
        lv_error_message := 'Error in procedure pkg_audit_info.p_load_AM: ' || SQLCODE ||
        ' -ERROR- ' || SUBSTR(SQLERRM,1,300) || '*' || dbms_utility.format_error_backtrace;
        RAISE_application_error(-20002,lv_error_message);
    END p_load_AM;
    END pkg_audit_info;
    Table1 and table1 exist in schema_01.
    All 2000 schemas have same package.procedures.
    Due to security reasons i have removed the actual code.
    I was able to execute the job successfully. However, when a schema procedure (SCHEMA_01.pkg_audit_info.p_load_COA) throws an exception, the job fails and all transaction is rolled back.
    Is there a way to loop through each schema and execute the related procedures. Even if exception happens, it should rollback only for that schema and continue the other schemas in the loop?
    Please let me know if there is a better way to achieve this. Is the way i am handling exceptions in the job/procedure correct?
    Thanks

    Hi,
    RAISE_APPLICATION_ERROR will cause the program to exit back to the caller, even if you place it in a block within the loop, so the RAISE or RAISE_APPLICATION_ERROR instruction should be placed in your "pkg_audit_info.p_load_AM" and "pkg_audit_info.p_load_coa" procedures. This way, you can use a block inside the loop and log the error.
    FOR i IN
        ( SELECT username FROM dba_users WHERE username LIKE 'ABCFIRM%'
        LOOP
           BEGIN
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_coa; end;';
            EXECUTE immediate vstmt;
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_am; end;';
            EXECUTE immediate vstmt;
    EXCEPTION
    WHEN OTHERS THEN  
        --> Log the error in a custom log table otherwise you will not know what happened for that schema: don't forget the username
    END;
    END LOOP;

  • How to "roll back" the model if a database update fails

    I'd like to know if there's a way to "roll back" the model (the values in the managed beans) if a service call to a database fails during the Invoke Application phase. My understanding of the JSF lifecycle is that the values in the model are updated before a service call to a database would happen. If the database update operation fails, it seems to me that the data in the model and the database would be inconsistent.
    For example, say I have a ridiculously simple application that updates a names database. The fields are id, last name, first name. The application has a simple view that allows the user to update a name in the database. The user updates the last name field for a particular record from "Doe" to "Smith" and clicks "submit". The request goes through the lifecycle, the model values are updated from the web form during the Update Model Values phase, then the call to update the database fails during the Invoke Applications phase (the database connection failed). When the Render Response phase completes, the UI would display an error message where I put <h:messages> but the last name value in the UI would show "Smith" instead of "Doe". Is there something I can do to roll the model value back to "Doe" if the database call fails?
    I know that I could redirect to a technical error page, but I'd like to avoid it unless it is the best thing to do.
    I'd appreciate any advice you can offer.
    Thanks.
    - Luke

    I'd like to know if there's a way to "roll back" the model (the values in the managed beans) if a service call to a database fails during the Invoke Application phase. My understanding of the JSF lifecycle is that the values in the model are updated before a service call to a database would happen. If the database update operation fails, it seems to me that the data in the model and the database would be inconsistent.
    For example, say I have a ridiculously simple application that updates a names database. The fields are id, last name, first name. The application has a simple view that allows the user to update a name in the database. The user updates the last name field for a particular record from "Doe" to "Smith" and clicks "submit". The request goes through the lifecycle, the model values are updated from the web form during the Update Model Values phase, then the call to update the database fails during the Invoke Applications phase (the database connection failed). When the Render Response phase completes, the UI would display an error message where I put <h:messages> but the last name value in the UI would show "Smith" instead of "Doe". Is there something I can do to roll the model value back to "Doe" if the database call fails?
    I know that I could redirect to a technical error page, but I'd like to avoid it unless it is the best thing to do.
    I'd appreciate any advice you can offer.
    Thanks.
    - Luke

  • Roll back in Adapter DataBase using Polling | BPEL 11g

    Hello Guys,
    I'm having a problem with roll back for polling "Update a field in Table(Logical Delete)" in DataBase Adapter BPEL 11g.
    My process is:
    Does polling in the table from the database changed the value in column from 0 for 1 and then put the message on a JMS queue.
    The problem is:
    When an exception occurs in the process, for example, exception when posting message in the queue, he does not roll back the database, then the value in the table column is changed to 1 and not 0 as it should.
    Adapter Data Base:
    Oracle XA
    Properties BPEL(Composite):
    <binding.jca config="XXXX_db.jca">
        <property name="singleton">true</property>
    </binding.jca>
    <component name="XXXXX" version="2.0">
        <implementation.bpel src="XXXXX.bpel"/>
        <property name="bpel.config.transaction" type="xs:string" many="false">required</property>
        <property name="bpel.config.oneWayDeliveryPolicy">sync</property>
    </component>
    Properties JCA of Data Base:
    <property name="DescriptorName" value="XXXXXXXXX"/>
          <property name="QueryName" value="XXXXXXSelect"/>
          <property name="MappingsMetaDataURL" value="XXXXXX-or-mappings.xml"/>
          <property name="PollingStrategy" value="LogicalDeletePollingStrategy"/>
          <property name="MarkReadColumn" value="STATUS"/>
          <property name="MarkReadValue" value="1"/>
          <property name="MarkReservedValue" value="2${weblogic.Name}-${IP}"/>
          <property name="MarkUnreadValue" value="0"/>
          <property name="PollingInterval" value="5"/>
          <property name="MaxRaiseSize" value="1"/>
          <property name="MaxTransactionSize" value="10"/>
          <property name="NumberOfThreads" value="1"/>
          <property name="ReturnSingleResultSet" value="false"/>
    Its roll back?
    Could anyone please help me on this.
    Tks,
    Azevedo, Artur.

    You need to ensure that your process is working in a single transaction.
    You are correctly using the XA datasource.
    Next you need to ensure that you do not have a dehydration point in the process and if there is a call to another BPEL process they are in a same transaction.

  • Rolled back JTA TX  marked active/inflight

              Hello. I am writing a message driven bean that utilizes container managed transaction
              demarcation for the onMessage method (letting the container worry about msg acknowledgement).
              The MDB relays message information to a legacy system. If the legacy system is
              down, I want to retry message delivery at a later point, so I mark the current
              transaction as rolled back (via the setRollbackOnly() method in my MessageDrivenContext).
              This causes the EJB container to continually call onMessage() with my message
              beans, creating a large amount of rolled back exceptions. These rolled back transactions,
              however, are marked as active/inflight by the WLS transaction manager, leading
              to resource starvation and inability to create transactions because of an overflow
              of the "Active Transaction" watermark (configurable in mydomain->JTA->Active Transactions),
              although the JTA monitoring tools clearly indicate that the TX has been rolled
              back.
              Eventually these "rolled back exceptions" are purged from the Inflight Transaction
              list, and I can once again create transactions. Any ideas on how to fix this/workarounds/bugfixes?
              Please cc: me if you respond as well
              Thanks,
              Alex
              ---- snippets follow ----
              Here is a snippet from the mydomain->myserver->Monitoring->JTA->Inflight Transactions
              page
              Name Status Servers Resources Properties
              (key=value)
              (none) Rolled back. [Reason = weblogic.transaction.internal.AppSetRollbackOnlyException]
              alexd {JMS_jmsStoreTest=rolledback} (none)
              And a listing of the JTA monitoring info
              Total Transactions: 45060
              Total Committed: 131
              Total Rolled Back: 44929
              Timeout Rollbacks: 0
              Resource Rollbacks: 0
              Application Rollbacks: 44929
              

    I know this is fixed in WLS 6.1's GA release. Basically, the problem is
              that the EJB container is marking the transaction for rollback where it
              should be rolling it back. That's why you have so many tx's in-flight.
              They are waiting to time-out.
              -- Rob
              Alex DeNeui wrote:
              >
              > Hello. I am writing a message driven bean that utilizes container managed transaction
              > demarcation for the onMessage method (letting the container worry about msg acknowledgement).
              >
              > The MDB relays message information to a legacy system. If the legacy system is
              > down, I want to retry message delivery at a later point, so I mark the current
              > transaction as rolled back (via the setRollbackOnly() method in my MessageDrivenContext).
              > This causes the EJB container to continually call onMessage() with my message
              > beans, creating a large amount of rolled back exceptions. These rolled back transactions,
              > however, are marked as active/inflight by the WLS transaction manager, leading
              > to resource starvation and inability to create transactions because of an overflow
              > of the "Active Transaction" watermark (configurable in mydomain->JTA->Active Transactions),
              > although the JTA monitoring tools clearly indicate that the TX has been rolled
              > back.
              >
              > Eventually these "rolled back exceptions" are purged from the Inflight Transaction
              > list, and I can once again create transactions. Any ideas on how to fix this/workarounds/bugfixes?
              >
              > Please cc: me if you respond as well
              >
              > Thanks,
              > Alex
              >
              > ---- snippets follow ----
              >
              > Here is a snippet from the mydomain->myserver->Monitoring->JTA->Inflight Transactions
              > page
              > -----------------
              > Name Status Servers Resources Properties
              > (key=value)
              > (none) Rolled back. [Reason = weblogic.transaction.internal.AppSetRollbackOnlyException]
              > alexd {JMS_jmsStoreTest=rolledback} (none)
              > -----------------
              >
              > And a listing of the JTA monitoring info
              > -----------------
              > Total Transactions: 45060
              > Total Committed: 131
              > Total Rolled Back: 44929
              > Timeout Rollbacks: 0
              > Resource Rollbacks: 0
              > Application Rollbacks: 44929
              > ------------------
              Coming Soon: Building J2EE Applications & BEA WebLogic Server
              by Michael Girdley, Rob Woollen, and Sandra Emerson
              http://learnweblogic.com
              

  • Bean-managed stateless session bean can't roll back using JTA

    I use weblogic6.1sp2 + jdk131
    a stateless session bean must do 2 things:
    insert a record to A table and delete another record in A table
    this bean has the same structure as the example in
    j2eetutorial/examples/src/ejb/teller
    I use TxDataSource in weblogic
    if delete fail, the roll back is run,but in database,
    the insert record is STILL in A table.
    any idea?

    make sure that your deployment descriptor says "transaction required".
    Also, If the insert and delete are two different methods, the client must call these two methods in the same transaction scope.

  • 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.

  • 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

  • Data Services job rolling back Inserts but not Deletes or Updates

    I have a fairly simple CDC job that I'm trying to put together. My source table has a record type code of "I" for Inserts, "D" for deletes, "UB" for Update Before and "UP" for Update After. I use a Map_CDC_Operation transform to update the destination table based on those codes.
    I am not using the Transaction Control feature (because it just throws an error when I use it)
    My issue is as follows.
    Let's say I have a set of 10,000 Insert records in my source table. Record number 4000 happens to be a duplicate of record number 1. The job will process the records in order starting with record 1 and begin happily inserting records into the destination table. Once it gets to record 4000 however it runs into a duplicate key issue and then my try/catch block catches the error and the dataflow will exit. All records that were inserted prior to the error will be rolled back in the destination.
    But the same is not true for updates or deletes. If I have 10000 deletes and 1 insert in the middle that happens to be an insert of a duplicate key, any deletes processed before the insert will not be rolled back. This is also the case for updates.
    And again, I am not using Transaction Control, so I'm not sure why the Inserts are being rolled back, but more curiously Updates and Deletes are not being rolled back. I'm not sure why there isn't a consistent result regardless of type of operation. Does anyone know what's going on here or  what I'm doing wrong/what my misconception may be?
    Environment information: both source and destination are SQL Server 2008 databases and the Data Services version we use is 14.1.1.460.
    If you require more information, please let me know.

    Hi Michael,
    Thanks for your reply. Here are all the options on my source table:
    My Rows per commit on the table is 10,000.
    Delete data table before loading is not checked.
    Column comparison - Compare by name
    Number of loaders - 1
    Use overflow file - No
    Use input keys - Yes
    Update key columns - No
    Auto correct load - No
    Include in transaction - No
    The rest were set to Not Applicable.
    How can I see the size of the commits for each opcode? If they are in fact different from my Rows per commit (10,000) that may solve my issue.
    I'm new to Data Services so I'm not sure how I would implement my own transaction control logic using a control column and script. Is there a guide somewhere I can follow?
    I can also try using the Auto correct load feature.  I'm guessing "upsert" was a typo for insert? Where is that option?
    Thank you very much!
    Riley

  • 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
              >
              

  • Rolling back from OIM version 11g to 9.1.0.2

    Experts,
    OIM version upgrade from 9.1.0.2 to 11g(11.1.1.5) need to be rolled back due to some error.
    Just wanted to know views of experts.
    Following steps have been completed so far of the upgrade guide [http://docs.oracle.com/cd/E21764_01/upgrade.1111/e10129/upgrade_oim.htm].
    •Task 1: Identify and Prepare Oracle Database for Oracle Identity Manager 11g (Optional)
    •Task 2: Use the Repository Creation Utility to Create the Schema in the Database
    •Task 3: Install Oracle Fusion Middleware
    •Task 4: Use Upgrade Assistant to Upgrade the Oracle Identity Manager Schema
    •Task 5: Create a WebLogic Domain for Oracle Identity Manager
    •Task 6: Start the WebLogic Administration Server
    •Task 7: Configure Oracle Identity Manager Server 11g
    •Task 8: Configure Node Manager to Start Managed Servers
    •Task 9: Start the SOA Managed Server
    •Task 10: Start the Oracle Identity Manager Managed Server
    •Task 11: Stop the Oracle Identity Manager Managed Server
    Rollback strategy:-
    1. Delete extra schemas(SOA MDC etc) created during Task2
    2. Restoring the OIM DB schema (of version 9.1.0.2) from backup.
    3. Updating back path and variables environment with old values
    4. Starting the weblogic and OIM application from old Middleware_home and OIM_HOME.
    Experts,
    Above rollback strategy would be enough or should i take some other point in consideration.
    If you can think of any other thing please share..
    Thanks,
    Manohar

    Yes your strategies seems fine. for dropping schema you can RCU as well.
    for restore, Drop all the entities manually from oim db schema So you don't have any grant issue while importing old 10g dump
    --nayan                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • 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

  • Calling mysql stored procedure having insert sql commands within cftransaction is not getting rolled back

    Hi,
    cftransaction is working perfectly when all the insert
    updates are called by cfqquery.
    But when there is a mysql stored procedure call with in
    cftrnsaction and that mysql stored procedure is having many inserts
    and updates, cftransaction is not able to roll back insert/updates
    happened in stored procedure.
    I am using InnoDB tables/database of mysql.
    Did anybody faced a similar problem and is it a coldfusion
    bug or mysql bug.
    We checked with Java and java is able to roll back the
    transaction, but coldfusion cftransaction is failing.
    Please help.
    Regards,
    Saikumar

    Mark,
    I believe the syntax of your formatted search is not right. I guess you are trying to get the U_Width from Item Master and the other values from the current form.
    SELECT @Width = T0.U_WTH FROM [dbo].[OITM] T0.WHERE T0.ItemCode = $[$38.1.0]
    EXEC TBC_CHOP @Width, $[$38.U_LINETYPE.0], $[$38.U_LI.0], $[$38.U_LN.0],
    $[$38.U_LD.0], $[$38.U_HI.0], $[$38.U_HN.0], $[$38.U_HD.0], $[$38.U_QTYORD.Number]
    If you see I have added a third parameter which is the Type to the formatted seach field selection $[$Item.Column.Type]
    I have made then all 0 but you may change it as per the col type.  This Type should be 0 for Char type columns, Number for numeric columns and Date for Date type cols
    Suda

  • 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

Maybe you are looking for