Topic
  • 1 reply
  • Latest Post - ‏2012-10-15T12:14:49Z by SystemAdmin
SystemAdmin
SystemAdmin
17917 Posts

Pinned topic Db2 9.7 SP4 error code 840 with Hibernate

‏2012-10-12T06:50:03Z |
Hi,

We are using hibernate (annotations) with DB2 9.7. We have a parent table with many child tables (a lot, and this will not be changed). When hibernate creates a select query, the select statement list gets so large that DB2 throws error code 840. This happens because hibenate creates a join with all the child tables available.

Has anyone had experience with similar problem? Thanks.
Updated on 2012-10-15T12:14:49Z at 2012-10-15T12:14:49Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: Db2 9.7 SP4 error code 840 with Hibernate

    ‏2012-10-15T12:14:49Z  
    Hello,

    You should limit the list of fields on top of the SELECT statement to the fields which will actually be used by the application :

    http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.messages.sql.doc/doc/msql00840n.html

    Btw the error returned is -840 (and not 840).

    Regards

    Yves-Antoine Emmanuelli