-->
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.  [ 9 posts ] 
Author Message
 Post subject: net.sf.hibernate.JDBCException occured in Informix DB
PostPosted: Tue Jan 13, 2004 4:34 am 
Newbie

Joined: Tue Jan 13, 2004 4:23 am
Posts: 5
Hi there,
I am now currently working in informix DB and running in Weblogic App Server. When i try to insert Blob data in table, it always throw me the following exceptions.

Notes: Weblogic Platform version 7 SP4,
Informix Driver Version 2.21.JC5
Informix Server Version 9.40.TC2
Hibernate Version 2.0.3

Thank You in advance!

Could not synchronize database state with session: blob_assign: error during processing or invalid LO argument
java.sql.SQLException: blob_assign: error during processing or invalid LO argument
at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3124)
at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3435)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2259)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2179)
at com.informix.jdbc.IfxSqli.executeCommand(IfxSqli.java:721)
at com.informix.jdbc.IfxResultSet.executeUpdate(IfxResultSet.java:305)
at com.informix.jdbc.IfxStatement.executeUpdateImpl(IfxStatement.java:882)
at com.informix.jdbc.IfxPreparedStatement.executeUpdate(IfxPreparedStatement.java:281)
at weblogic.jdbc.pool.Statement.executeUpdate(Statement.java:318)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.jav
a:478)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.jav
a:454)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:20)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2100)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2061)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2005)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:57)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 4:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
How is your class and mapping? How do you handle the blob?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 4:51 am 
Newbie

Joined: Tue Jan 13, 2004 4:23 am
Posts: 5
Thank you for ur reply.

I have a XML file which has following declaration for DO mapping:
<property name="action_file">
<column name="action_file" sql-type="blob" not-null="true"/>
</property>

And here is DO class:
public class ActionFileDO implements Serializable {
private byte[] action_file;

public ActionFileDO() {
super();
}

public byte[] getAction_file() {
return action_file;
}
}

Lastly here is my insertion method goes:
protected void addWorkflow(ActionFileDO actionFile)throws HibernateException {

Session session = null;
Transaction transaction = null;
try{
SessionFactory sessionFactory = new Configuration().configure
().buildSessionFactory();
session = sessionFactory.openSession();
transaction = session.beginTransaction();
session.save(actionFile);
transaction.commit();
} catch (HibernateException e) {
bla......bla......
}


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 4:57 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Please take a look at: http://www.hibernate.org/73.html - use a UserType to get the Blob from the result set, exactly as you would do with JDBC.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 5:03 am 
Newbie

Joined: Tue Jan 13, 2004 4:23 am
Posts: 5
Again thanks for your reply! :)

I just tested in another development environment which is same as mine, that running in WL7.0, informix DB. That is working fine. What could be the other possibilities that cause the exceptions? Please advise.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 5:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Crappy Driver? Database issues?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 5:15 am 
Newbie

Joined: Tue Jan 13, 2004 4:23 am
Posts: 5
The machine are using the same version of Informix driver, version 2.21.JC5. But one running in Sun Solaris and another running in Windows XP. Does this matters?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 5:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Surely not for hibernate. Probably for your database or driver, don't know.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 5:23 am 
Newbie

Joined: Tue Jan 13, 2004 4:23 am
Posts: 5
Alright. Will investigate the database now. Many thanks to ur reply. :)


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