You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Vamsi Atluri <vk...@yahoo.com> on 2005/12/27 18:29:50 UTC

rrayIndexOutOfBoundsException when updating objects

Hello all,

I am currently using ojb 1.0.1. I have a table with several references.
The first time when I insert to this table everything inserts correctly.
The next time, when I need to update this row, I retrieve the reference
from DB, update the values and call broker.store() again. That's when I
get the following error:

java.lang.ArrayIndexOutOfBoundsException: 1
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.setFKField(PersistenceBrokerImpl.java:1045)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.link(PersistenceBrokerImpl.java:988)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeAndLinkOneToOne(PersistenceBrokerImpl.java:780)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeReferences(PersistenceBrokerImpl.java:755)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBrokerImpl.java:1594)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:1557)
at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:715)
at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.java:175)
at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.java:175)


Why would I run into this exception when I am updating? And it does work
correctly when it stores the row the first time. Any help is greatly
appreciated. Thank you.

Regards,
-Vamsi

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: rrayIndexOutOfBoundsException when updating objects

Posted by Thomas Dudziak <to...@gmail.com>.
On 12/27/05, Vamsi Atluri <vk...@yahoo.com> wrote:

> I am currently using ojb 1.0.1. I have a table with several references.
> The first time when I insert to this table everything inserts correctly.
> The next time, when I need to update this row, I retrieve the reference
> from DB, update the values and call broker.store() again. That's when I
> get the following error:
>
> java.lang.ArrayIndexOutOfBoundsException: 1
> at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.setFKField(PersistenceBrokerImpl.java:1045)

This normally happens when the number of columns in a foreign key
(reference/collection) is not the same as the targeted primary key.
It would help if you post your respitory definition and the code that
exhibits the exception.

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org