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 "McCaffrey, John G." <Jo...@kraft.com> on 2003/06/05 20:20:48 UTC
pre-fetched relationships error
I have been trying to get around an issue (limited Collection returned
thread) , and I have noticed that if I set auto-retrieve=false on my
reference objects, I get the right number of rows returned (minus the
objects of course). So then I wanted to use the pre-fetched relationships to
fill in those objects, but I am getting an error.
( I know that I am working around an issue in an ugly way, but I need to get
this working, and I haven't been able to figure out what OJB is actually
doing that it won't return all of the rows)
when trying to use pre-fetched realationships I get the error
[6/5/03 12:48:03:646 CDT] 2dce7472 SystemOut U
[org.apache.ojb.broker.accesslayer.RsIterator] ERROR: beforeFirst failed !
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0125E Function sequence
error. SQLSTATE=HY010
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGe
nerator.java:269)
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGe
nerator.java:206)
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGen
erator.java:474)
at
COM.ibm.db2.jdbc.app.DB2ScrollableResultSet.fetchOneRow(DB2ScrollableResultS
et.java:486)
at
COM.ibm.db2.jdbc.app.DB2ScrollableResultSet.beforeFirst(DB2ScrollableResultS
et.java:195)
at
com.ibm.ejs.cm.proxy.ResultSetProxy.beforeFirst(ResultSetProxy.java:76)
at
org.apache.ojb.broker.accesslayer.RsIterator.prefetchRelationships(Unknown
Source)
It doesn't matter which reference object I use, I get the same error. it
seems to go through and get the objects, but it always fails on the last
one.
I am using 1.0.rc3 (not latest from cvs)
wsad, datasource, db2
has any one else had an issue with prefetchedrelationships?
any help would be greatly appreciated (getting to the end of my rope)
thanks
-John
Re: 1:m relation not updating
Posted by Thomas Mahler <th...@web.de>.
You have to lock the b elements too if you are using normal collections
to hold the many-side of the association.
If you were using DList as your collection class this won't be required.
cheers,
thomas
Saman Ghodsian wrote:
> Hi there,
>
> Here is the situation...... Say I have class A and class B 1----->m
>
> I created the repository.xml
>
> Everything works fine when storing A to DB with a couple of B's
>
> Tx.lock(a, Transaction.WRITE);
> Tx.Commit
>
>
> Next step is to load a and add more B's and then save it again.....
>
> I created the query..... And all a and the related B's get loaded ok....
>
> Now I add a couple more B's
> And store a
>
>
> Tx.lock(a, Transaction.WRITE);
> Also tried
> Tx.lock(a, Transaction.UPGRADE);
>
> But the new B's don't get inserted in DB.....
> Any ideas????
>
> Thanks
>
>
>
> Sam
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
1:m relation not updating
Posted by Saman Ghodsian <gs...@shaw.ca>.
Hi there,
Here is the situation...... Say I have class A and class B 1----->m
I created the repository.xml
Everything works fine when storing A to DB with a couple of B's
Tx.lock(a, Transaction.WRITE);
Tx.Commit
Next step is to load a and add more B's and then save it again.....
I created the query..... And all a and the related B's get loaded ok....
Now I add a couple more B's
And store a
Tx.lock(a, Transaction.WRITE);
Also tried
Tx.lock(a, Transaction.UPGRADE);
But the new B's don't get inserted in DB.....
Any ideas????
Thanks
Sam
Re: pre-fetched relationships error
Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi john,
imo this is an issue with your jdbc-driver. could you please provide
more info about the error thrown by the driver ?
jakob
McCaffrey, John G. wrote:
>I have been trying to get around an issue (limited Collection returned
>thread) , and I have noticed that if I set auto-retrieve=false on my
>reference objects, I get the right number of rows returned (minus the
>objects of course). So then I wanted to use the pre-fetched relationships to
>fill in those objects, but I am getting an error.
>
>( I know that I am working around an issue in an ugly way, but I need to get
>this working, and I haven't been able to figure out what OJB is actually
>doing that it won't return all of the rows)
>
>when trying to use pre-fetched realationships I get the error
>
>
>[6/5/03 12:48:03:646 CDT] 2dce7472 SystemOut U
>[org.apache.ojb.broker.accesslayer.RsIterator] ERROR: beforeFirst failed !
>COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0125E Function sequence
>error. SQLSTATE=HY010
> at
>COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGe
>nerator.java:269)
> at
>COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGe
>nerator.java:206)
> at
>COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGen
>erator.java:474)
> at
>COM.ibm.db2.jdbc.app.DB2ScrollableResultSet.fetchOneRow(DB2ScrollableResultS
>et.java:486)
> at
>COM.ibm.db2.jdbc.app.DB2ScrollableResultSet.beforeFirst(DB2ScrollableResultS
>et.java:195)
> at
>com.ibm.ejs.cm.proxy.ResultSetProxy.beforeFirst(ResultSetProxy.java:76)
> at
>org.apache.ojb.broker.accesslayer.RsIterator.prefetchRelationships(Unknown
>Source)
>
>It doesn't matter which reference object I use, I get the same error. it
>seems to go through and get the objects, but it always fails on the last
>one.
>
>I am using 1.0.rc3 (not latest from cvs)
>wsad, datasource, db2
>has any one else had an issue with prefetchedrelationships?
>any help would be greatly appreciated (getting to the end of my rope)
>thanks
>-John
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
>
Re: pre-fetched relationships error
Posted by Michael Schulze <mi...@t-systems.com>.
Hi,
i too had a problem with prefetched relationships, db2 and the app jdbc
driver. In my case no rows were returned at all when using prefetched
relationships. the net jdbc driver worked fine.
db2 fixpak 8 solved the problem for me.
cheers,
Michael
On Thu, 2003-06-05 at 20:20, McCaffrey, John G. wrote:
> I have been trying to get around an issue (limited Collection returned
> thread) , and I have noticed that if I set auto-retrieve=false on my
> reference objects, I get the right number of rows returned (minus the
> objects of course). So then I wanted to use the pre-fetched relationships to
> fill in those objects, but I am getting an error.
> when trying to use pre-fetched realationships I get the error
>
>
> [6/5/03 12:48:03:646 CDT] 2dce7472 SystemOut U
> [org.apache.ojb.broker.accesslayer.RsIterator] ERROR: beforeFirst failed !
> COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0125E Function sequence
> error. SQLSTATE=HY010
> at
> COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGe
Re: pre-fetched relationships error
Posted by Michael Becke <be...@u.washington.edu>.
John,
I am not sure how helpful this is, but my setup is much the same as you
describe. I was having various strange errors and eventually upgraded
to a recent snapshot from CVS. This seems to have fixed my problems.
Mike
McCaffrey, John G. wrote:
> I have been trying to get around an issue (limited Collection returned
> thread) , and I have noticed that if I set auto-retrieve=false on my
> reference objects, I get the right number of rows returned (minus the
> objects of course). So then I wanted to use the pre-fetched relationships to
> fill in those objects, but I am getting an error.
>
> ( I know that I am working around an issue in an ugly way, but I need to get
> this working, and I haven't been able to figure out what OJB is actually
> doing that it won't return all of the rows)
>
> when trying to use pre-fetched realationships I get the error
>
>
> [6/5/03 12:48:03:646 CDT] 2dce7472 SystemOut U
> [org.apache.ojb.broker.accesslayer.RsIterator] ERROR: beforeFirst failed !
> COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0125E Function sequence
> error. SQLSTATE=HY010
> at
> COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGe
> nerator.java:269)
> at
> COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGe
> nerator.java:206)
> at
> COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGen
> erator.java:474)
> at
> COM.ibm.db2.jdbc.app.DB2ScrollableResultSet.fetchOneRow(DB2ScrollableResultS
> et.java:486)
> at
> COM.ibm.db2.jdbc.app.DB2ScrollableResultSet.beforeFirst(DB2ScrollableResultS
> et.java:195)
> at
> com.ibm.ejs.cm.proxy.ResultSetProxy.beforeFirst(ResultSetProxy.java:76)
> at
> org.apache.ojb.broker.accesslayer.RsIterator.prefetchRelationships(Unknown
> Source)
>
> It doesn't matter which reference object I use, I get the same error. it
> seems to go through and get the objects, but it always fails on the last
> one.
>
> I am using 1.0.rc3 (not latest from cvs)
> wsad, datasource, db2
> has any one else had an issue with prefetchedrelationships?
> any help would be greatly appreciated (getting to the end of my rope)
> thanks
> -John
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>