db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anurag Shekhar (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-2729) temporary lob file should be cleaned when the transaction or connection is no longer valid.
Date Wed, 30 May 2007 15:03:15 GMT

     [ https://issues.apache.org/jira/browse/DERBY-2729?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Anurag Shekhar updated DERBY-2729:

    Attachment: derby-2729.diff

Life cycle of a lob object is within the a transaction. when a connection is closed or a rollback
or commit is called, either explicitly by calling 
connection.commit or connection.rollback, or a rollback called due to an 
exception with severity  TRANSACTION or higher or an implicit commit when 
autoCommit is set to true.

Locator patch for client has introduced a hash map (lobHashMap) in 
EmbeddedConnection to track all the lob associated with the connection 
and at commit, rollback and close clearHashMap method is called to 
cleanup the hashmap and calling free method on individual hash map.

I am relying on same methods to do cleanup for embedded server. 
In the constructor of EmbedBlob calls EmbeddedConnection.addLOBMapping method to add entry
for the blob.

I have also added code to call clearLOBMapping when transaction is commited when autoCommit
mode is on. And when an StandardException with severity TRANSACTION or higher.

Due to this change the EmbeddedBlob now any call to EmbeddedBlob after commit or rollback
now results in exception with SQLState set to SQLState.LOB_OBJECT_INVALID. I have added additional
check to see if connection is closed, this ensures the same sql state what is thrown right
now without this patch.
Its not possible to determine whether the blob was closed due to explicit call to free or
its because transaction is no more valid. So if a blob is accessed after commit/rollback it
results in SQLException with SQL state set to  SQLState.LOB_OBJECT_INVALID.

modified files
added code to call clearLOBMapping in commitIfNeeded, commitIfAutoCommit and handleException


added call to EmbedConnection to add entry for this object in lobMapping. 
added additional check for validity of connection in checkValidity

updated the expected SQLStates.      

updated the expected locator id. Now blob constructor is adding itself to  the lob so the
id received by the stored procedure will be different. 

> temporary lob file should be cleaned when the transaction or connection is no longer
> -------------------------------------------------------------------------------------------
>                 Key: DERBY-2729
>                 URL: https://issues.apache.org/jira/browse/DERBY-2729
>             Project: Derby
>          Issue Type: Bug
>            Reporter: Anurag Shekhar
>            Assignee: Anurag Shekhar
>             Fix For:
>         Attachments: derby-2729.diff

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message