Hello,

I am currently porting our stuff to current CSV head 
(OJB 0.9.9) and I am experiencing problems with this 
issue (OJB48 / OJB123).

Armin, you introduced the PersistenceBrokerHelper.
and in TransactionImpl, line 883, you do:                 

Object[] objPkValues 
 = this.getBroker().serviceBrokerHelper().getKeyValues(cld, newTxObject);

In this case, the field conversion should not take place.
Since it does, I later reach

assertFkAssignment():816, org.apache.ojb.odmg.TransactionImpl
assignReferenceFKs():841, org.apache.ojb.odmg.TransactionImpl
lock():260, org.apache.ojb.odmg.TransactionImpl
lockCollections():931, org.apache.ojb.odmg.TransactionImpl
register():782, org.apache.ojb.odmg.TransactionImpl
lock():289, org.apache.ojb.odmg.TransactionImpl

with refPkValues[0] instanceOf java.math.BigDecimal

which results in the follwing exception:

13954 ERROR [main] fieldaccess.PersistentFieldDefaultImpl - while set field:

[...]
target field type: long
object value class: java.math.BigDecimal
[...]
13969 ERROR [main] odmg.TransactionImpl - Locking obj [...] with lock mode 4
failed
java.lang.IllegalArgumentException
        at
sun.reflect.UnsafeLongFieldAccessorImpl.set(UnsafeLongFieldAccessorImpl.java
:84)
        at java.lang.reflect.Field.set(Field.java:519)
        at
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl.set(Pe
rsistentFieldDefaultImpl.java:147)
        at
org.apache.ojb.odmg.TransactionImpl.assertFkAssignment(TransactionImpl.java:
816)
        at
org.apache.ojb.odmg.TransactionImpl.assignReferenceFKs(TransactionImpl.java:
841)
        at
org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:260)
        at
org.apache.ojb.odmg.TransactionImpl.lockCollections(TransactionImpl.java:931
)
        at
org.apache.ojb.odmg.TransactionImpl.register(TransactionImpl.java:782)
        at
org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:289)


A potential fix is in TransactionImpl, line 883

Object[] objPkValues 
 = this.getBroker().serviceBrokerHelper().getKeyValues(cld, newTxObject,
false);  // added last parameter

What do you think?
I have not tried the test case that you, Armin, have introduced.
If the test does not fail, there mightbe somethinng 
wrong with the test  (Missing collections?)

Regards,
        Olli


> -----Original Message-----
> From: Armin Waibel [mailto:[EMAIL PROTECTED]]

> The bug you describe reside in a part of OJB that wasn't
> my special subject, thus the best thing I think is to post
> a test case. I will check in the test ASAP.


> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> 
> Hello,

> want to ask again.  I am pretty sure that
> this bug is due to an issuficient fix for OJB48.
> That fix just applies to the PersistenceBroker API,
> but when using the ODMG API, a different
> assertFKAssignment() method is used.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to