db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øystein Grøvlen <Oystein.Grov...@Sun.COM>
Subject Generating calls to stored procedures in autocommit mode
Date Mon, 02 Apr 2007 23:16:03 GMT
In the current work to use locators for LOBs on client, we have defined 
a set of stored procedures that will be called to operate on the LOBs at 
the server (ref. DERBY-208).

Testing my experimental code for locator support, shows that my 
implementation has problems with auto-commit mode.  One scenario is a 

   1. Client sends "select <blob-column> from <table>" to server
   2. Server executes queries, sends reply
   3. Client does ResultSet.next() to get the first row of result set.
   4. Server create locator to blob mapping and sends back locator.
   5. Client calls stored procedures to get (part of) the blob value.

If auto-commit is on, step 5 will cause the current transaction to 
commit.  Since locators are only supposed to be valid for the duration 
of the transaction, this results in that the locator to blob mapping is 
cleared, and when the stored procedure is executed, the specified 
locator is not found.  Hence, we want step 5 to execute in the same 
transaction as the previous steps.

I have looked around in the client trying to find whether there are 
other mechanism with similar needs, but I have not found anything yet. 
Can anyone point me to existing code where the client execute 
sql-statements as a side effect of user operations.  (Maybe there are 
similar issus when SQL is executed for metadata calls?)   Pointers and 
advice will be highly appreciated.


View raw message