-->
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.  [ 3 posts ] 
Author Message
 Post subject: Inserting Large Text Issue
PostPosted: Tue Oct 02, 2007 4:18 pm 
Newbie

Joined: Tue Oct 02, 2007 3:45 pm
Posts: 2
I am having problem inserting (session.persist(object)) a column with large text. However, if I insert it without value (or small text) in that column and then update it, it works fine.

Why is large text works during update but not insert?

Note: The column type in question is "text".

Thanks.


Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.2

Mapping documents:http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
could not insert: [test]

Name and version of the database you are using: Sybase Adaptive Server Enterprise/15.0.1

The generated SQL (show_sql=true):
insert into test (name, description) values(?,?)

Debug level Hibernate log excerpt:
Oct 2, 2007 00:00:00 PM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: JZ0NK
Oct 2, 2007 00:00:00 PM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: JZ0NK: Generated keys are not available because either the Statement.NO_GENERATED_KEYS was used or no keys were automatically generated.



Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 3:16 am 
Newbie

Joined: Mon Oct 01, 2007 8:59 am
Posts: 18
You can use
session.save(object) or session.saveOrUpdate(object) for saving large text.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 3:39 pm 
Newbie

Joined: Tue Oct 02, 2007 3:45 pm
Posts: 2
It didn't work.

I explicitly set the column to type="text" in the hbm file. It still doesn't work.

The insert (persist) is also part of a transaction.

Anyone had this issue before?

Thanks.


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