-->
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: Creating a clob using Hibernate in Hibernate 5
PostPosted: Wed Apr 13, 2016 12:26 am 
Newbie

Joined: Wed Apr 13, 2016 12:10 am
Posts: 3
Is there a utility in Hibernate to create clob with out passing session in Hibernate 5? As i know

Hibernate.getLobCreator(Session).createClob(string)

Is there any other utility that i can use instead of passing a session??


Top
 Profile  
 
 Post subject: Re: Creating a clob using Hibernate in Hibernate 5
PostPosted: Wed Apr 13, 2016 2:08 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
The Hibernate utility has an overloaded method which takes a SessionImplementor, so you can either pass in a Session or a StatelessSession.

Basically, you need a JDBC connection to create a CLOB, so if you either use this utility, or try to do it manually from a JDBC Connection.


Top
 Profile  
 
 Post subject: Re: Creating a clob using Hibernate in Hibernate 5
PostPosted: Wed Apr 13, 2016 2:52 am 
Newbie

Joined: Wed Apr 13, 2016 12:10 am
Posts: 3
mihalcea_vlad wrote:
The Hibernate utility has an overloaded method which takes a SessionImplementor, so you can either pass in a Session or a StatelessSession.

Basically, you need a JDBC connection to create a CLOB, so if you either use this utility, or try to do it manually from a JDBC Connection.

Could you please elobarte? Why do we need a connection? CLOB is ideally a character stream isn't it? Older version, Hibernate.createClob doesnt have a connection needed.


Top
 Profile  
 
 Post subject: Re: Creating a clob using Hibernate in Hibernate 5
PostPosted: Wed Apr 13, 2016 3:33 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
How can you create a Clob without calling Connection#createClob method?


Top
 Profile  
 
 Post subject: Re: Creating a clob using Hibernate in Hibernate 5
PostPosted: Wed Apr 13, 2016 3:38 am 
Newbie

Joined: Wed Apr 13, 2016 12:10 am
Posts: 3
Earlier version of Hibernate had Hibernate.createClob(String), if we call a plain prepared statement
we use psmt.setCharacterStream(i, stream, length);, so I was wondering why the new feature takes session, perhaps its internally using conn.createClob.


Top
 Profile  
 
 Post subject: Re: Creating a clob using Hibernate in Hibernate 5
PostPosted: Wed Apr 13, 2016 4:04 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
That got deprecated and was removed.


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.