Issue Details (XML | Word | Printable)

Key: DERBY-8
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Mamta A. Satoor
Reporter: Tulika Agrawal
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Connection object gets created with un-supported holdability on getting Connection object from XAConnection "inside" the global transaction

Created: 28/Sep/04 01:00 AM   Updated: 12/Apr/06 02:26 AM
Return to search
Component/s: JDBC
Affects Version/s: 10.0.2.0
Fix Version/s: 10.1.1.0, 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works Derby8_Derby366_061805.txt 2005-06-18 04:54 PM Mamta A. Satoor 33 kB
Issue Links:
Duplicate
 

Resolution Date: 12/Apr/06 02:26 AM


 Description  « Hide
Reporting for Mamta Satoor, filed on Derby-dev list.

I think there is a bug in Derby when the user code tries to get the
Connection object from XAConnection "inside" the global transaction.
In this case, the Connection object gets created with un-supported
holdability. Look at the following piece of code and it's output to
see what exactly happens
    EmbeddedXADataSource dscsx = new EmbeddedXADataSource();
    dscsx.setDatabaseName("wombat");
    XAConnection xac = dscsx.getXAConnection("fred", "wilma");
    XAResource xr = xac.getXAResource();
    xid = getXid(27, (byte) 21, (byte) 01);
    xr.start(xid, XAResource.TMNOFLAGS);
    conn1 = xac.getConnection();
    System.out.println("This is a bug. Connection's holdability should
have been CLOSE_CURSORS_AT_COMMIT since it is in the global
transaction");
    System.out.println("CONNECTION(in xa transaction) HOLDABILITY " +
(conn1.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
    System.out.println("Autocommit on Connection inside global
transaction has been set correctly to " + conn1.getAutoCommit());
    xr.end(xid, XAResource.TMSUCCESS);
The output for the above piece of code is
    This is a bug. Connection's holdability should have been
CLOSE_CURSORS_AT_COMMIT since it is in the global transaction
    CONNECTION(in xa transaction) HOLDABILITY true
    Autocommit on Connection inside global transaction has been set
correctly to false


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mamta A. Satoor made changes - 18/Jun/05 04:54 PM
Field Original Value New Value
Attachment Derby8_Derby366_061805.txt [ 12310836 ]
Kathey Marsden made changes - 23/Jun/05 03:15 AM
Link This issue is duplicated by DERBY-346 [ DERBY-346 ]
Mamta A. Satoor made changes - 23/Jun/05 09:13 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Mamta A. Satoor made changes - 23/Jun/05 09:13 AM
Status Resolved [ 5 ] Closed [ 6 ]
Mamta A. Satoor made changes - 23/Jun/05 09:14 AM
Assignee Mamta A. Satoor [ mamtas ]
Mamta A. Satoor made changes - 12/Apr/06 02:25 AM
Resolution Fixed [ 1 ]
Status Closed [ 6 ] Reopened [ 4 ]
Mamta A. Satoor made changes - 12/Apr/06 02:26 AM
Fix Version/s 10.1.1.0 [ 10993 ]
Fix Version/s 10.2.0.0 [ 11187 ]
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Closed [ 6 ]