Frank Renaers wrote:
Hi,
We are using OJB 1.0rc4
Before doing an insert, we are using the PersistenceBroker retrieveAllReferences to
resolve all references of our object.
Why you do try retrieve references for a new object? OJB couldn't find any.
But it seems that this method not only resolves all the references, but also
generates a new oid.
Is this normal behaviour ?
Indeed this should not happen. But it wasn't expected that this method was called with an new object.
The problem is BrokerHelper#getValuesForObject method. this method was indirectly called by PB#retrieveAll... method and does obtain new PK values from the sequence manager if not assigned.
In our application this causes some problems because we are doing
some business validations between retrieveAllReferences and the insert.
Is there a workaround for this ?
Don't call this method when do an insert ;-)
I'm not sure if we should do an existence check in PB.retrieveAll... because this will be an performance issue and this method doesn't expect newly objects.
regards, Armin
The oid should be generated during the insert !
-- Current behaviour --
1) retrieveAllReferences (GENERATES ALSO THE NEW OID ???)
2) business validations
3) insert
-- Expected behaviour --
1) retrieveAllReferences
2) business validations
3) insert ( + GENERATING THE NEW OID)
Thanks,
Frank Renaers - Ikan Software Belgium
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
