Concurrent transactions

Hi, please consider a plain old Java (not EJBs) application for a book store.
The application offer 3 operations:
1. Add new book (Store the book info in the DB).
2. Remove book (remove the book info from the DB).
3. Modify book (update the book info in the DB).
The system must support multiple users doing requests at the same time, thus the application must support concurrent transactions.
The ANSI/ISO SQL standard defines the four isolation levels: READ UNCOMMITTED, READ COMMITTED, REPEATABLE READS, SERIALIZABLE. Each level provides certain degree of isolation, the greatest isolation level is SERIALIZABLE but I've readed from several sources that it's not convenient to use this level because it causes a heavy impact in the performance and thus suggests to use READ COMMITTED.
As far I know, the first three isolation levels don't provide perfect isolation: they allow ugly problems to appear like dirty reads, unrepeatable reads and phantom reads.
What should I do to provide isolation to my system while using READ COMMITTED?
I think that lots of people have faced this problem over years, and the question is: Are there some "common" or "standard" techniques to solve this?
In other words, what is the correct approach to solve this?
Thank you very much for the help.

I have written two programs to test the situation.
The first program uses JDBC.
The second program uses hibernate.
Both programs show the same result: The final copies count is wrong. The "lost updates" problem is occurring in both.
Preconditions:
Create a database.
Create the table BOOK: create table BOOK (BOOK_ID INTEGER, TITLE VARCHAR(30), COPIES INTEGER, PRIMARY KEY(BOOK_ID))
Insert in the table the row with BOOK_ID = 1, Title = "The Java Patterns", COPIES = 7:
Below is the code for the JDBC test.
public class LostUpdatesTest3 {
     private static CyclicBarrier barrier = null;
     public static void main(String[] args) throws Exception {
          Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
          int numOfThreads = 5;
          Thread[] threads = new Thread[numOfThreads];          
          barrier = new CyclicBarrier(numOfThreads);
          for (int i = 0; i < numOfThreads; i++) {
               threads[i] = new MyTransaction();
               threads.setName("thread " + i);
               threads[i].start();
          for (Thread thread : threads) {
               thread.join();
     private static class MyTransaction extends Thread {
          public void run() {
               Connection con = null;
               try {
                    con = DriverManager.getConnection(
                              "jdbc:derby:d:/pruebas/jdbc1db;create=true", "root", "root");
                    con.setAutoCommit(false);
                    Statement statement = con.createStatement();
                    ResultSet resultSet = statement.executeQuery("SELECT * FROM BOOK");
                    resultSet.next();
          int id = resultSet.getInt("BOOK_ID");
          int copies = resultSet.getInt("COPIES");
                    barrier.await();
                    PreparedStatement preparedStatement = con.prepareStatement(
                    "UPDATE BOOK SET COPIES = ? WHERE BOOK_ID = ?");
                    preparedStatement.setInt(1, copies - 1);
                    preparedStatement.setInt(2, id);
                    preparedStatement.executeUpdate();
                    con.commit();
                    statement.close();
                    preparedStatement.close();
                    con.close();
               } catch (Exception e) {
                    e.printStackTrace();
This test creates 5 threads and starts them. Each thread runs a transaction to reduce 1 to the copies count.
At the end of the test, the book have COPIES = 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Concurrent transactions problem- Can anybody help?- very urgent

    I have tested our application for multiple transactions i.e. concurrent transactions between two servers with IIS and Tomcat environment. We found some unexpected result and which is irrespective of the data (size ranging from 10 bytes to 10 kb, 50kb 70kb etc) sending across the servers on
    I was testing with 5 transactions (with data size of 13 bytes) from one machine (server1) i.e 5 windows of internet explorer. When I clicked on all the five, one after another quickly, I found that 4 transactions got success and one browser went to hang mode.
    Second time when I clicked on it, I found that 3 transactions got success, 1 in hang mode and 1 failed.
    We traced the exception at the point where it fails. Everytime it fails while reading the response back from the other end through InputStreamBuffer. The block in which it fails is
    Please follow the piece of code which i have written
    //reading response from the destination decrypt url,
    //which is also encrypted and signed
    //sending the same to caller of encrypt
    String data="";
    int end=0;
    char c[]=new char[4*1024];
    BufferedReader buf=null;
    //reading data in a chunks of data
    try
    inr=new InputStreamReader(connection.getInputStream());
    buf=new BufferedReader(inr,12*1024);
    while ((end=buf.read(c))!=-1)
    data=new StringBuffer(data).append(c,0,end).toString();
    catch(OutOfMemoryError e)
    System.out.println("Out of memory errror"+e.getMessage());
    try
    response.sendError(HttpServletResponse.SC_NOT_FOUND);
    return;
    catch(Exception e1)
    return;
    catch(Exception e1)
    System.out.println("Failure in reading response"+e1.getMessage());
    try
    response.sendError(HttpServletResponse.SC_NOT_FOUND);
    return;
    catch(Exception e2)
    return;
    finally
    try
    if(inr!=null)
    inr.close();
    if(buf!=null)
    buf.close();
    if (connection != null)
    connection.disconnect();
    catch(Exception e)
    System.out.println("Error in closing connection"+e.getMessage());
    Here the connection get disconnected and throws the following exceptions at difterent time of testing in failure case.
    1. Failure in reading response JVM_recv in socket input stream read (code=10004)
    Error in closing connection Socket closed
    2. Null pointer exception.
    Could you please tell us what would be the reasons for the above exceptions or failure and how to rectify or handle it.
    Thanks & Regards
    Gabriel

    - First, do not use BufferedReader.
    Use InputStream.read(byte[]) and make them to an String.
    If does not help use another stable version of TOMCAT
    on the same way.
    Also it is better to read the data over the Servlet API
    methods not over the IO streams.
    e.g. request.getParameter("XXX")
    - Do not close the socket connection in TOMCAT.
    TOMCAT themselves close the connection for you.
    Use the flush() method for getting the data faster.

  • Application crashes nearing 28 concurrent transactions

    Its been a while folks.... I used to post and answer allot
    here back in the day when i was coding in CF daily.
    Here is the problem... more details will follow when I get
    them. I was tasked by my director to look into a problem for an
    application on the network. NOTE: I know longer work in CF I
    haven't used it since I got certified on version 5.0 ( I knew I
    should have pulled my CF experience off my resume
    Anyway this is what I have so far, its not much but I was
    hoping someone out there has seen this and it a known
    infrastructure problem.
    This is what I got:
    "the issue is when they get up to 28 concurrent transactions,
    the application crashes"
    They are using ColdFusion Ver 7 Enterprise Edition
    (7.0.2.142559).
    Webservers ( 3 of them )
    HP Proliant BL25 G1
    4GB Ram 67GB Disk (via 2 disks mirrored) 2 dual-core 2.20GHz
    AMD processors
    Windows 2000 SP4
    IIS 5
    ColdFusion Ver 7 Enterprise Edition ( 7.0.2.142559 )
    Sun Java 1.4.2_13
    Course Content Server
    2GB Ram 4 x 3.2GHz Intel CPU
    Windows 2000 SP4
    IIS 5
    Apache Tomcat 4.1
    DB Server ( active/passive cluster)
    HP Proliant BL45P G1
    8GB Ram 67GB Disk (via 2 disks mirrored) 4 dual-core 2.2GHz
    AMD processors
    Windows 2003 SP1 Enterprise Edition
    Microsoft SQL 2000 Server Enterprise Edition SP4

    Thanks for your reply I am working on getting the log once I
    get access to the server Admin. They set the system to monitor
    everything and they are trying to replicate the problem to generate
    some type of useful log.
    I did have a call with the Client and they indicated that
    under large volumes.. 1/3 web servers hangs and does not take
    requests. The other 2 work fine and and CF runs as designed. All
    run IIS 5

  • [Oracle 10g] How to show concurrent transactions during a period?

    Hello all,
    I used Oracle 10g database
    I try to select the number of concurrent transactions during a period.
    I know how to select the number of transactions executed in one day, but i want to know the concurrent transactions.
    Can you help me ?
    Thanks in advance
    Regards
    Mathieu

    Which transactions do you wish to track?
    Are you referring to transactions that occur against a specific set of tables or all transactions against a schema and/or database instance?

  • Add new mandatory column without killing concurrent transactions

    I know of several approaches to this problem, but as the table in question is key to my organisation, I'd quite like to get this right first time!
    I need to add a 1 character column to a large (approx 1 million rows, approx 100 cols) table which also happens to be central to our database (contains client details). The table is involved in the majority of transactions on our database, 24/7 so I need to find the method with the least impact on concurrent transactions.
    We use mod_plsql for our applications, and a previous attempt (by another developer) caused all web pages to become unresponsive, followed by a database shutdown.
    Any advice?

    Just a note that I ended up writing a pl/sql script which used a select for update cursor to update the non-locked rows, and stored any locked rowids in an associative array. It then looped round the array trying to update these rows until they were all done. Did the trick. DBA wasn't keen or the redefinition package when he saw what it did!
    thanks,
    M

  • Concurrent transactions in servlets using HttpConnectionURL class

    I have tested our application for multiple transactions i.e. concurrent transactions between two servers with IIS and Tomcat environment. We found some unexpected result and which is irrespective of the data (size ranging from 10 bytes to 10 kb, 50kb 70kb etc) sending across the servers on
    I was testing with 5 transactions (with data size of 13 bytes) from one machine (server1) i.e 5 windows of internet explorer. When I clicked on all the five, one after another quickly, I found that 4 transactions got success and one browser went to hang mode.
    Second time when I clicked on it, I found that 3 transactions got success, 1 in hang mode and 1 failed.
    We traced the exception at the point where it fails. Everytime it fails while reading the response back from the other end through InputStreamBuffer. The block in which it fails is
    Please follow the piece of code which i have written
    //reading response from the destination decrypt url,
    //which is also encrypted and signed
    //sending the same to caller of encrypt
    String data="";
    int end=0;
    char c[]=new char[4*1024];
    BufferedReader buf=null;
    //reading data in a chunks of data     
    try
         inr=new InputStreamReader(connection.getInputStream());
         buf=new BufferedReader(inr,12*1024);          
         while ((end=buf.read(c))!=-1)
              data=new StringBuffer(data).append(c,0,end).toString();
    catch(OutOfMemoryError e)
         System.out.println("Out of memory errror"+e.getMessage());
         try
              response.sendError(HttpServletResponse.SC_NOT_FOUND);
              return;
         catch(Exception e1)
              return;
    catch(Exception e1)
         System.out.println("Failure in reading response"+e1.getMessage());
         try
              response.sendError(HttpServletResponse.SC_NOT_FOUND);
              return;
         catch(Exception e2)
              return;
    finally
         try
              if(inr!=null)
                   inr.close();
              if(buf!=null)
                   buf.close();
              if (connection != null)
                   connection.disconnect();     
         catch(Exception e)
              System.out.println("Error in closing connection"+e.getMessage());
    Here the connection get disconnected and throws the following exceptions at difterent time of testing in failure case.
    1. Failure in reading response JVM_recv in socket input stream read (code=10004)
    Error in closing connection Socket closed
    2. Null pointer exception.
    Could you please tell us what would be the reasons for the above exceptions or failure and how to rectify or handle it.
    Thanks & Regards
    Gabriel

    Can anybody look into it , this very urgent
    thanks
    Gabriel

  • Concurrent Transactions,Disaster Recovery

    Hello friends,
    I have an application on sql server which is used for online reservation.Could you tell me roadmap in order to handle  concurrent transaction and disaster recovery plan? I am using sql server 2008 R2.
    Thanks in advance.

    Hi,
    I suggest you read this article:
    High Availability and Disaster Recovery (OLTP)---a Technical Reference Guide for Designing Mission-Critical OLTP Solutions
    http://msdn.microsoft.com/en-us/library/ms190202.aspx
    If one high-availability option cannot meet the requirement, you
    may consider combining some of the high-availability options.
    The white paper Proven SQL Server Architectures for High Availability and Disaster Recovery2 shows the details of five commonly used architectures:
    ◦ Failover clustering for HA and database mirroring for DR.
    ◦ Synchronous database mirroring for HA/DR and log shipping for additional DR.
    ◦ Geo-cluster for HA/DR and log shipping for additional DR.
    ◦ Failover clustering for HA and storage area network (SAN)-based replication for DR.
    ◦ Peer-to-peer replication for HA and DR (and reporting).
    The whitepaper also describes the architectures and also presents case studies that illustrate how real-life customers have deployed these architectures to meet their business requirements. You can download it here:
    Proven SQL Server Architectures for High Availability and Disaster Recovery
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Same update in concurrent transactions

    same update statement in concurrent transactions, update 10 records
    update test set id=id where rownum<10
    first transaction update 1,2,3,4,5,6,7,8,9,10
    second transaction update 10,9,8,7,6,5,4,3,2,1
    This may lead to deadlock?
    That will not happen under normal circumstances
    but row migration

    872390 wrote:
    same update statement in concurrent transactions, update 10 records
    update test set id=id where rownum<10
    first transaction update 1,2,3,4,5,6,7,8,9,10
    second transaction update 10,9,8,7,6,5,4,3,2,1
    This may lead to deadlock?
    That will not happen under normal circumstances
    but row migrationrefer the link:-http://www.orafaq.com/node/854

  • Transfer Object Pattern and Concurrency Transaction Mgmt

    I am developing an application that implements a remote rich client. For
    performance reasons I have chosen to use the Transfer Object pattern. I
    have been very successful with this from a performance standpoint, it
    really paid off. I am using it in combination with an assembler pattern
    to construct Transfer Objects for the view and to also reassemble domain
    objects based on changes made to transfer objects on my client side.
    Anyways the only problem I am having with it is I can't seem to figure
    out how I should implement optimistic locking with it. Is there a best
    practices to handle transaction control here?
    I generally try to keep visibility of stale data down, but there are still
    situations where concurrent clients could have requested to edit the same
    the Transfer Object at the same time. I would ideally like to handle this
    using a flavor of optimistic locking. I in fact have implemented
    optimistic locking on the domain side, but now I am not sure how or if I
    should integrate this into the Transfer Object or View side. The version
    field used in optimistic locking is generally a hidden field. The only
    way I can see to handle this with the view side is to expose this field on
    the Domain Objects and actually store it into assembeled transfer objects.
    This seems like it may be a bad idea from a design standpoint.
    The problem is the client requests data and it assembled and delivered to the client. Then at some later time the client may send a request to the server to update this data. At this time a new transaction must be started where the server reloads the domain data and copies over the requested changes. Since the domain data was just loaded you wouldn't ever trigger a versioning problem unless the version was maintained on the transfer object and copied over as well. I am developing this project with hibernate on the back end and unfortunately hibernate doesn't acknowledge manual changes to the version field.
    I just feel like there must be a better way to do this. I believe that using the Transfer Object or DTO pattern for remote client/server architectures is pretty common. So there must be a best practice to deal with concurrency? Suggestions, insight, lay it on me please.
    thx

    I personal respect both concepts and am using both in an application I am currently work.
    Firstly, I have my Transfer Object which I call xxxData.
    Next, the entities are called xxx
    I have my DAO classes that handles all CRUD operation. but within the DAO class I have two methods
    private <EntityClass> retrieveEntityFromObject(<EntityClassData> data) {}
    private <EntityClassData> retrieveEntityFromObject(<EntityClass> entity) {}so with these methods, I separate my business logic from my data layer. My codes will alway use data objects instead of entities. For example, a create method will be
    public ProductData createProduct(ProductData data)
         entity.persist(retrieveEntityFromObject(data));
    }I hope someone understands
    Regards

  • Concurrent transaction isolation

    Hello,
    I am building a multithreaded application that uses the Semantic Jena APIs that relies on the transactions of the different threads to be isolated before a commit but I'm not quite getting this behavior. Here's a simple example (the full example source is available upon request).
    <h1>Thread 1</h1>
    Open a connection
    Get a GraphOracleSem from the connection
    call GraphOracleSem.getTransactionHandler.begin()
    Add Triple A
    Add Triple B
    Add Triple C
    call GraphOracleSem.getTransactionHandler.commit()
    Close the GraphOracleSem
    Dispose the connection
    Open a connection
    Get a GraphOracleSem from the connection
    call GraphOracleSem.getTransactionHandler.begin()
    Add Triple A
    Add Triple B
    Add Triple C
    call GraphOracleSem.getTransactionHandler.commit()
    Close the GraphOracleSem
    Dispose the connection
    <h1>Thread 2</h1>
    Open a connection
    Get a GraphOracleSem from the connection
    call GraphOracleSem.getTransactionHandler.begin()
    CheckA = true if Triple A Exists
    CheckB = true if Triple B Exists
    CheckC = true if Triple C Exists
    Throw Exception unless CheckA == CheckB == CheckC
    call GraphOracleSem.getTransactionHandler.abort() //no write is necessary here
    Close the GraphOracleSem
    Dispose the connection
    Now if the effects of the two threads were isolated from each other, CheckA and CheckB and CheckC would always be equivalent (sometimes, true, sometimes false) but this does not seem to be the case (when my code at least...). I'm not sure if this requires a Serializeable transaction isolation level to be specified but quoting the GraphOracleSem performAdd method:
    <h4>"Adds a triple into the graph. This change to this graph object will not be persisted until the transaction is committed. However, subsequent queries (using the same Oracle connection) can see this change."</h4>
    Doesn't this mean that two connections making changes to GraphOracleSem should not see each-other's changes until a commit? Or is there something I'm missing here?
    Also if this isn't the way to get something like this to work, how can it be done?
    Edited by: alexi on Nov 11, 2010 12:22 PM - Whoops, cant attach anything to this forum

    Hi,
    I am afraid you cannot use it this way.
    See this example using SQL inserts directly. Assume there are two concurrent sessions.
    Session 1:
    SQL> set transaction isolation level serializable;
    Transaction set.
    SQL> insert into basic_tpl values(sdo_rdf_triple_s('basic','<urn:a>','<urn:b>','<urn:c_123>'));
    1 row created.
    Session 2:
    SQL> set transaction isolation level serializable;
    Transaction set.
    SQL> insert into basic_tpl values(sdo_rdf_triple_s('basic','<urn:a>','<urn:b>','<urn:c_567>'));
    insert into basic_tpl values(sdo_rdf_triple_s('basic','<urn:a>','<urn:b>','<urn:c_567>'))
    ERROR at line 1:
    ORA-08177: can't serialize access for this transaction
    ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 7538
    ORA-06512: at "MDSYS.BASIC_INS", line 37
    ORA-04088: error during execution of trigger 'MDSYS.BASIC_INS'
    SQL> rollback;
    Rollback complete.
    SQL> insert into basic_tpl values(sdo_rdf_triple_s('basic','<urn:a>','<urn:b>','<urn:c_567>'));
    insert into basic_tpl values(sdo_rdf_triple_s('basic','<urn:a>','<urn:b>','<urn:c_567>'))
    ERROR at line 1:
    ORA-55303: SDO_RDF_TRIPLE_S constructor failed: BNode-non-reuse case:
    SQLERRM=ORA-06519: active autonomous transaction detected and rolled back
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_RDF_TRIPLE_S", line 64
    If you want application level serialization, you can use dbms_lock package to acquire a lock before
    performing updates. Another simple way is to create a simple table with one row and do a "select * from tabName for update." You can add a "nowait" if you don't want your session to be blocked.
    Hope it helps,
    Zhe Wu

  • Concurrent transactions on a table

    We have a setup where business users can run SQR jobs against a table. Some times I end up seeing two similar transactions being run on the server.When I analysed these transactions I could see that one transaction (A) is active in the Rollback and the wait message indicates this event "SQL net message from client" . The other transaction (B) is basically complete. When I asked the user why he had to run the same report twice, he said the first report was kind of hung up which actually gets reflected in the wait event for that session.
    so here is my question..
    1. How long the data pertaining to the Transaction A will be in the Rollback segment? I have seen that this Rollback segment holds this information for hours.
    I am not sure if this is because of the transaction volume in the DB.
    2. What will happen if I kill the Transaction A ? Ideally it should do a roll back right.
    Regards,
    BMP

    Hello BMP,
    i don't know what SQR jobs are, but....
    1. How long the data pertaining to the Transaction A will be in the Rollback segment? I have seen that this Rollback segment holds this information for hours.The data will be in the rollback segment until you commit / rollback the transaction.
    The "SQL*Net message from client" is an idle event of the database, and the process waits for input/data from the client. So i would guess that the problem is at your client processing.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/waitevents003.htm#sthref4553
    If you commit/rollback the transaction the data will be available until the undo retention, but this is another story...
    2. What will happen if I kill the Transaction A ? Ideally it should do a roll back right.Yeah, thats right... if the transaction changes some data until the wait event "SQL*Net message from client" and you kill the transaction... it will be rolled back.
    Or are you hitting such a scenario like that?
    http://oracletoday.blogspot.com/2005/09/sqlnet-message-from-client.html
    Regards
    Stefan

  • Concurrent Serializable Transaction Conflict

    Hi,
    We are planning to use the Serializable isolation level in the transactions. I am wondering if somebody can give me some suggestions on how to handle the following scenarios.
    My assumptions are as follows ( when I use the transactions with Serializable isolation level):
    If transaction A updates a particular record r of table T, and concurrently, transaction B updates or deletes the same record r of table T, then anexception is thrown at the point at which either transaction (A or B whichever is last) is committed. But if the two transactions update or delete different records of the same table, there will be no problems.
    Are these assumptions are correct. If the oracle jdbc driver throws an exception, what would be the exception ( what would be the class and the error code - how i can differntiate from other SQLExceptions)
    TIA,
    Krishna Balusu

    If two serializable transactions attempt to update the same row, the second transaction to attempt to update the data will wait for the first transaction to commit. Then, it will return the error "ORA-08177: can't serialize access for this transaction". This error won't be deferred until the second transaction attempts to commit.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Issues with transaction isolation levels (BEA-631 exceptions)

    My intended EJB application will have a session bean that uses two very similar entity beans that will be mapped to different databases; in my test version the entity beans use the same database.
    The final application will need XA transactions with isolation=serializable (beans may be in Oracle, DB2, or MSSQL databases); high probability of concurrent potentially interfering transactions.
    My test example works (Windows XP, WebLogic 8.1, Oracle 9.2) with both BEA's Oracle driver, and the Oracle driver but only when I set a transaction isolation on the session bean as the Oracle specific "transactionreadcommitedforupdate".
    If I try using "transactionserializable", I get an exception like the following when my session-bean first tries to find an entity bean:
    <2/09/2005 10:13:43 AM EST> <Warning> <Common> <BEA-000631> <Unknown resource "weblogic.jdbc.common.internal.ConnectionEnv@1f13e99" being released to pool "BEAOraclePool". Printing out current pool contents.>
    (similar response with both drivers).
    Please could someone explain what is wrong and why setting isolation serializable causes problems. How
    should I fix things?

    Hi. What version of 8.1 is this?
    If you can easily reproduce this
    we may either have a fix, or will
    want to debug this.
    Joe
    Neil Gray wrote:
    The bit about "cleaning up vendor connections" was from the comment by Imeshev that was earlier in this thread.
    The context:
    Application does involve possibility of two concurrent transactions trying to change the same row of a datatable; as isolation level is repeatableread or serializable, this will result in some exceptions. Sometimes exceptions handled ok, sometimes they cause problems.
    Particular case illustrated below is when working with DB2. As I understand it, the two concurrent EJBs both make read requests (presumably acquiring read locks) then make update requests - if they happen to share a row this will block. I don't know enough about DB2 to know what controls its detection of problems. In practice I see db2 typically sending back an error to one of requestors in less than 1 second, but sometimes several seconds may elapse before the error response gets sent (I have observ
    ed actual net traffic).
    If transaction gets timed out in WebLogic (I've curently got a generous 8 second timeout setting in JTA tab) then there are problems.
    First of two exceptions shown here is for normal case where db2 returned an error and it was handled ok:
    11111111111111111
    ####<30/09/2005 10:55:39 AM EST> <Error> <EJB> <ATP-NL2-RS3> <examplesServer> <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-1D5B56A9177C58E3D95B(17477508),Status=Rolled back. [Reason=weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - with nested exception:
    [weblogic.jdbc.base.BaseBatchUpdateException: [BEA][DB2 JDBC Driver]Abnormal end unit of work condition occurred.]],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=10,XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=rolledback,assigned=examplesServer),xar=BEADB2,re-Registered = false),SCInfo[examples+examplesServer]=(state=rolledback),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.Bi
    gDecimal)], ISOLATION LEVEL=4}),local properties=({modifiedListeners=[weblogic.ejb20.internal.TxManager$TxListener@eed1b8]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+): weblogic.jdbc.base.BaseBatchUpdateException: [BEA][DB2 JDBC Driver]Abnormal end unit of work condition occurred.
         at weblogic.jdbc.db2.DB2ImplStatement.executeBatch(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.commonExecute(Unknown Source)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    --------------- nested within: ------------------
    weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - with nested exception:
    [weblogic.jdbc.base.BaseBatchUpdateException: [BEA][DB2 JDBC Driver]Abnormal end unit of work condition occurred.]
         at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java:673)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    --------------- nested within: ------------------
    weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion: sync=weblogic.ejb20.internal.TxManager$TxListener@eed1b8
    Error writing from beforeCompletion - with nested exception:
    [weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - with nested exception:
    [weblogic.jdbc.base.BaseBatchUpdateException: [BEA][DB2 JDBC Driver]Abnormal end unit of work condition occurred.]]
         at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    .>
    222222222222222
    Second case is where timeout in WebLogic occurred (I think) which leads to something messing up the connection pool
    ####<30/09/2005 10:56:24 AM EST> <Warning> <Common> <ATP-NL2-RS3> <examplesServer> <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<anonymous>> <BEA1-22BE56A9177C58E3D95B> <BEA-000631> <Unknown resource "weblogic.jdbc.common.internal.ConnectionEnv@1551d57" being released to pool "BEADB2". Printing out current pool contents.>
    ####<30/09/2005 10:56:24 AM EST> <Warning> <Common> <ATP-NL2-RS3> <examplesServer> <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-000631> <Unknown resource "weblogic.jdbc.common.internal.ConnectionEnv@1551d57" being released to pool "BEADB2". Printing out current pool contents.>
    ####<30/09/2005 10:56:24 AM EST> <Warning> <Common> <ATP-NL2-RS3> <examplesServer> <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-000631> <Unknown resource "weblogic.jdbc.common.internal.ConnectionEnv@f95d4a" being released to pool "BEADB2". Printing out current pool contents.>
    ####<30/09/2005 10:56:24 AM EST> <Error> <EJB> <ATP-NL2-RS3> <examplesServer> <ExecuteThread: '14' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-22BD56A9177C58E3D95B(18185360),Status=Rolled back. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 8 seconds
    Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-22BD56A9177C58E3D95B(18185360),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=8,seconds left=10,activeThread=Thread[ExecuteThread: '14' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=started,assigned=none),xar=BEADB2,re-Registered = false),SCIn
    fo[examples+examplesServer]=(state=pre-preparing),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)], ISOLATION LEVEL=4}),local properties=({modifiedListeners=[weblogic.ejb20.internal.TxManager$TxListener@1f2a681], weblogic.jdbc.jta.BEADB2=weblogic.jdbc.wrapper.TxInfo@1a4ef37}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},
    NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+)],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=9,seconds left=9,XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=rolledback,assigned=examplesServer),xar=BEADB2,re-Registered = false),SCInfo[examples+examplesServer]=(state=rolledback),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)], ISOLATION LEVEL=4})
    ,local properties=({modifiedListeners=[]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+): weblogic.transaction.internal.TimedOutException: Transaction timed out after 8 seconds
    Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-22BD56A9177C58E3D95B(18185360),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=8,seconds left=10,activeThread=Thread[ExecuteThread: '14' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=started,assigned=none),xar=BEADB2,re-Registered = false),SCIn
    fo[examples+examplesServer]=(state=pre-preparing),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)], ISOLATION LEVEL=4}),local properties=({modifiedListeners=[weblogic.ejb20.internal.TxManager$TxListener@1f2a681], weblogic.jdbc.jta.BEADB2=weblogic.jdbc.wrapper.TxInfo@1a4ef37}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},
    NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+)
         at weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1614)
         at weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:1117)
         at weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1881)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    --------------- nested within: ------------------
    weblogic.transaction.RollbackException: Transaction timed out after 8 seconds
    Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-22BD56A9177C58E3D95B(18185360),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=8,seconds left=10,activeThread=Thread[ExecuteThread: '14' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=started,assigned=none),xar=BEADB2,re-Registered = false),SCIn
    fo[examples+examplesServer]=(state=pre-preparing),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)], ISOLATION LEVEL=4}),local properties=({modifiedListeners=[weblogic.ejb20.internal.TxManager$TxListener@1f2a681], weblogic.jdbc.jta.BEADB2=weblogic.jdbc.wrapper.TxInfo@1a4ef37}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},
    NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+) - with nested exception:
    [weblogic.transaction.internal.TimedOutException: Transaction timed out after 8 seconds
    Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-22BD56A9177C58E3D95B(18185360),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=8,seconds left=10,activeThread=Thread[ExecuteThread: '14' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=started,assigned=none),xar=BEADB2,re-Registered = false),SCIn
    fo[examples+examplesServer]=(state=pre-preparing),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)], ISOLATION LEVEL=4}),local properties=({modifiedListeners=[weblogic.ejb20.internal.TxManager$TxListener@1f2a681], weblogic.jdbc.jta.BEADB2=weblogic.jdbc.wrapper.TxInfo@1a4ef37}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},
    NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+)]
         at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:325)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    .>
    Once start getting those things released to pool the application falls apart. Shortly afterwards it loses all connections to DB2 (and DB2 may be left with some locks on the table that have to be cleared).
    It isn't DB2 specific, if needed I can supply similar data for MSSQL server (BEA or MS drivers)

  • Oracle 9iAS is rolling back all my transactions...any idea why?

    Hi Guys,
    I am involved in developing a medium sized J2EE Application Running on Oracle9iAS
    Develeopment Version obtained from OTN.(version 1.0.2.2a)
    The backend DB is Oracle8i RDBMS.
    It has Browser based web client.
    It is presently having 2- stateless session beans, with one bean acting as
    Session Facade(as per J2EE Blueprints 1.2)
    All transactions are container managed.
    Following observations are made while load testing:
    1. 9iAS Server rollbacks all the transactions when number of simultaneous
    users exceeds 45.
    Following are the Queries:
    1. Is there any restriction on the number of Concurrent Transactions on the
    9iAS Server Development version.
    2. Is there any restriction on the pool size of the Resource Manager(Data
    base in this case) on the 9iAS Development Version.
    3. Exactly what is the difference between the Development and the Proper
    Production release.
    4. Are there any thing to do with my RAM?
    This is my data-sources.xml -
    <?xml version="1.0"?>
    <!DOCTYPE data-sources PUBLIC "Orion data-sources" " " target="_new">http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
    <data-sources>
    <data-source
    class="com.evermind.sql.DriverManagerDataSource"
    name="demoPool"
    location="demoPool"
    xa-location="jdbc/demoPool"
    ejb-location="jdbc/demoPool"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    max-connect-attempts="10"
    max-connections="1000"
    username="cue"
    password="cue"
    url="jdbc:oracle:thin:@163.122.23.104:1521:CALVYN"
    inactivity-timeout="30"
    </data-sources>
    Thanks in advance

    Do you have any more information related to this? I don't see any errors. Are you getting any other indications like a timeout or something else? Are there any database errors being recieved?
    1. Is there any restriction on the number of Concurrent Transactions on the 9iAS Server Development version. No.
    2. Is there any restriction on the pool size of the Resource Manager(Data base in this case) on the 9iAS Development Version. No.
    3. Exactly what is the difference between the Development and the Proper Production release. The core J2EE components are the same.
    4. Are there any thing to do with my RAM? Not likely.
    Thanks -- Jeff

  • 9iAS is rolling back transactions..anyone has any idea why?

    I am involved in developing a medium sized J2EE Application Running on Oracle9iAS
    Develeopment Version obtained from OTN.(version 1.0.2.2a)
    The backend DB is Oracle8i RDBMS.
    It has Browser based web client.
    It is presently having 2- stateless session beans, with one bean acting as
    Session Facade(as per J2EE Blueprints 1.2)
    All transactions are container managed.
    Following observations are made while load testing:
    1. 9iAS Server rollbacks all the transactions when number of simultaneous
    users exceeds 45.
    Following are the Queries:
    1. Is there any restriction on the number of Concurrent Transactions on the
    9iAS Server Development version.
    2. Is there any restriction on the pool size of the Resource Manager(Data
    base in this case) on the 9iAS Development Version.
    3. Exactly what is the difference between the Development and the Proper
    Production release.
    4. Are there any thing to do with my RAM?
    This is my data-sources.xml -
    <?xml version="1.0"?>
    <!DOCTYPE data-sources PUBLIC "Orion data-sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
    <data-sources>
         <data-source
              class="com.evermind.sql.DriverManagerDataSource"
              name="demoPool"
              location="demoPool"
              xa-location="jdbc/demoPool"
              ejb-location="jdbc/demoPool"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              max-connect-attempts="10"
              max-connections="1000"
              username="cue"
              password="cue"
              url="jdbc:oracle:thin:@163.122.23.104:1521:CALVYN"
              inactivity-timeout="30"
    </data-sources>
    Thanks in advance

    I have no idea, but Mobo manufacturers are rushing new products to the market to be the first with 333, 400, what's next?  My strategy is to read the reviews but wait until the board (or CPU) is sub top and buy it when the bugs have been ironed out (or well documented in fora like this) and the price has come down.  Sorry, I am Dutch!

Maybe you are looking for

  • How to connect my Satellite E105-S1402 to an external projector?

    Hi everybody I own a Satellite E105-S1402 that has an HDMI port. Unfortunately, the projector we use in my office is not HD ready so it has regular VGA input connector (DB9). How can I connect it to this type of projectors? Do I have to use a digital

  • MRP Run with Scheduling Agreement

    Hi All,             Can anyone explain the the Scheduling Agreements, we are running the MRP with schedule lines generated.I want to know the complete cycle with the T-codes in sequence they are executed.My requirement is business people need a demo

  • How can I view my friend's itunes library?

    Is there any way that my friend and I could browse each other's itunes music libraries?  It would be ideal to be able to click and sample songs as well.  We don't want to share the actual music files.  This is strictly to expose one another to each o

  • No one from Verizon has addressed my previous post, so I'll ask again:

    WHAT IN THE HECK happened during the 5/22/14 update that messed up Android phones on Verizon? Is it possible to UN-update??? I have a Motorola Droid Razr M. ( I have a friend who has a Samsung Galaxy Note, and she is having similar problems as me). 

  • Coding Question Because of Compiling Issues

    Hi there, I need help with some code, here it is. import java.util.*; import java.text.*; public class InvestCalc {      //declaration of instance variables      private double interest, principal;      //default constructor, sets interest and princi