-->
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.  [ 6 posts ] 
Author Message
 Post subject: Disabling Alias names while parsing query
PostPosted: Mon Mar 29, 2004 9:15 am 
Newbie

Joined: Mon Mar 29, 2004 5:17 am
Posts: 3
Hi,

when hibernate parses the query it creates alias name for each column which may be more than 18 characters. DB2 on mainframe doesn't allow alias names more than 18 chars. Is there a way of disabling this?

Rgds,
Matt

[3/27/04 16:44:17:482 GMT+05:00] 427576 JDBCException W cirrus.hibernate.helpers.JDBCExceptionReporter SQL Error: -107, SQLState: 42622

[3/27/04 16:44:17:501 GMT+05:00] 427576 JDBCException E cirrus.hibernate.helpers.JDBCExceptionReporter [IBM][CLI Driver][DB2] SQL0107N The name "MANUAL_ENT_ALLOWED1" is too long. The maximum length is "18". SQLSTATE=42622

[3/27/04 16:44:17:513 GMT+05:00] 427576 SystemOut O [date=Sat Mar 27 16:44:17 GMT+05:00 2004, tid=Servlet.Engine.Transports : 0] EXCEPTION: [IBM][CLI Driver][DB2] SQL0107N The name "MANUAL_ENT_ALLOWED1" is too long. The maximum length is "18". SQLSTATE=42622

[3/27/04 16:44:17:514 GMT+05:00] 427576 SystemOut O COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2] SQL0107N The name "MANUAL_ENT_ALLOWED1" is too long. The maximum length is "18". SQLSTATE=42622

[3/27/04 16:44:17:514 GMT+05:00] 427576 SystemOut O at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:281)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 30, 2004 3:54 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Upgrade to Hibernate 2.1


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 04, 2004 6:07 am 
Newbie

Joined: Mon Mar 29, 2004 5:17 am
Posts: 3
Thankyou this has fixed Column Alias problem.

However now an exception is thrown when inserting using saveOrUpdate().

The following code

session.saveOrUpdate(f42);
session.flush();
session.connection().commit();

causes this exception.

[4/4/04 15:35:11:860 GMT+05:30] 6619424 SessionImpl E net.sf.hibernate.impl.SessionImpl Could not synchronize database state with session

[4/4/04 15:35:11:891 GMT+05:30] 6619424 SessionImpl E net.sf.hibernate.impl.SessionImpl TRAS0014I: The following exception was logged net.sf.hibernate.HibernateException: SQL insert, update or delete failed (row not found)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:25)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:688)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:641)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2382)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2336)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204)

Any ideas why upgrading would lead to this problem?

Thankyou.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 04, 2004 8:13 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
i also had this issue upgrading.
It is not a problem, maybe last version is less "permissive" (don't know if this word exists in english).

You can be sure that there is a good reason why this is occuring.

Can you show the code before
Code:
session.saveOrUpdate(f42);
session.flush();
session.connection().commit();


?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 04, 2004 9:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Follow all these instructions:

http://www.hibernate.org/Documentation/ ... Guidelines


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 06, 2004 10:30 am 
Newbie

Joined: Mon Mar 29, 2004 5:17 am
Posts: 3
Thankyou I now have it working fine when using DB2 8.0 on Windows 2000, however when I run it on the DB2 7.2 on OS390 I get the following exception.

I have tried both the DB2Dialect and DB2400 dialect as suggested in the following post.

http://www.hibernate.org/80.185.html

Using the hibernate.properties file

hibernate.dialect=net.sf.hibernate.dialect.DB2400Dialect


[4/6/04 18:40:13:332 GMT+05:30] 32ee7cb2 SystemOut O Hibernate: insert into GCDEV.f42 (ADDRESS_1, ADDRESS_2, ADDRESS_3, ADDRESS_4, CONTACT, NAME, PHONE_NO, LAST_UP_TAD, EXEC_BRK_CODE) values (?, ?, ?, ?, ?, ?, ?, ?, ?)

[4/6/04 18:40:14:442 GMT+05:30] 32ee7cb2 JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: -804, SQLState: 07002

[4/6/04 18:40:14:442 GMT+05:30] 32ee7cb2 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter [IBM][CLI Driver][DB2] SQL0804N The application program input parameters for the current request are not valid. Reason code "103". If a host variable or SQLVAR in the SQLDA is invalid then: host variable/SQLVAR number = "2", SQLTYPE = "453", SQLLEN = "0", host variable/SQLVAR type = "INPUT". SQLSTATE=07002

[4/6/04 18:40:14:442 GMT+05:30] 32ee7cb2 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter could not insert: [com.mbl.gcs.staticdata.execbroker.hibernate.F42#ABY]

[4/6/04 18:40:14:442 GMT+05:30] 32ee7cb2 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter TRAS0014I: The following exception was logged COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2] SQL0804N The application program input parameters for the current request are not valid. Reason code "103". If a host variable or SQLVAR in the SQLDA is invalid then: host variable/SQLVAR number = "2", SQLTYPE = "453", SQLLEN = "0", host variable/SQLVAR type = "INPUT". SQLSTATE=07002


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.