-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: Please Help! "The statement is too long or too complex&
PostPosted: Fri Nov 07, 2003 6:19 pm 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
Hi all,

I am stuck with this one:

Caused by: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/SUN] SQL0101N The statement is too long or too complex. SQLSTATE=54001

at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:270)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:207)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:458)
at COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2(DB2PreparedStatement.java:2110)
at COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeQuery(DB2PreparedStatement.java:1596)
at com.mchange.v2.c3p0.impl.C3P0PreparedStatement.executeQuery(C3P0PreparedStatement.java:188)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$2.executeQuery(C3P0PooledConnection.java:473)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:83)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:631)
at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:166)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:111)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:663)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:678)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:57)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:49)
at net.sf.hibernate.persister.NormalizedEntityPersister.load(NormalizedEntityPersister.java:415)
... 14 more
Exception in thread "main"

What can I do ??
How can I tell Hibernate to build shorter SQL queries?

TIA,
--steve p.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 08, 2003 11:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Not nearly enough info here. And I'll leave it at that.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 09, 2003 1:04 pm 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
Steve,

The statement is basically a SELECT in a large object graph using outer join = true. If you want, I can try to paste that VERY large statement, but I will have to trim out confidential info.

Another question please:

Will the dimension of the SELECT statement depend on wether I use or don't use lazy?

thx,

--steve p.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 09, 2003 6:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
If the statement is to long when using outer joins then remove the outer join (false) so the graph will be populated using multiple smaller SQL statements.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 09, 2003 7:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
HIbernate 2.1 provides the hibernate.max_fetch_depth property which is very useful


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 9:01 am 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
gavin wrote:
HIbernate 2.1 provides the hibernate.max_fetch_depth property which is very useful


It works by setting the above value, but it is much, much slower :(

thx,

--steve p.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 9:57 am 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
Of couse I do not know specific of your project but generally idea of fetching "as much as you can" is very bad idea. Probably you can focus on data you really need and fetch only them (making everything else lazy/proxy)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 14, 2003 10:52 pm 
Regular
Regular

Joined: Tue Sep 09, 2003 9:37 pm
Posts: 56
Location: Ogden, Utah, USA
There's also a DB2 setting that you can change to allow larger statements... I don't remember what it was but I found it via google.

Good luck,
Jenica


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.