db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Gallagher <rgall...@bellsouth.net>
Subject Bug in PersistenceBrokerImpl::storeToDb()
Date Tue, 18 Feb 2003 00:41:47 GMT
I have found what I believe is a bug in how PersistenceBrokerImpl stores objects in the cache.
 In our environment, we're using Oracle packages to handle all persistence operations.  The
"ADD" function is structured to assign any primary key values and return the newly assigned
values back to the caller.  We've got all of this working via custom extensions to various
components, including JdbcAccess.

Here's the problem.  Prior to the execution of storeToDb routine, an Identity is constructed
using the original primary key values.  In our case, these values for a new object will always
be 0.  The construction of the Identity occurs in store(Object,ObjectModification).  When
execution gets to the storeToDb method, the Identity that was constructed using the 'original'
primary key values is used to place the newly stored object in the cache.  The problem for
us is that during storage (dbAccess.executeInsert(cld, obj);), our extension to JdbcAccess
updates the primary key value in "obj" with the value that was returned by the corresponding
Oracle package.  When "obj" is placed in the cache, it needs to be identified using the new
value(s) for the primary key.

The change is to simply construct an Identity using the current primary key values from "obj".
 I've attached a file containing this change.

Ron Gallagher
Atlanta, GA
rongallagher@bellsouth.net

Mime
View raw message