-->
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.  [ 2 posts ] 
Author Message
 Post subject: Does Hibernate close the Blob InputStream
PostPosted: Tue Mar 22, 2011 3:02 pm 
Newbie

Joined: Tue Mar 22, 2011 12:42 pm
Posts: 1
Does Hibernate 3.1 close the Blob InputStream once the Blob is persisted?

Given the following...
FileInputStream fileInputStream = new FileInputStream("filename");
Blob blob = Hibernate.createBlob(fileInputStream);
entity.setBlob(blob);
entityManager.persist(entity);

The FileInputStream needs to be closed so I need to know if I need to close it or if Hibernate is closing it.


Top
 Profile  
 
 Post subject: Re: Does Hibernate close the Blob InputStream
PostPosted: Mon Dec 05, 2011 7:48 am 
Newbie

Joined: Fri Feb 08, 2008 6:53 am
Posts: 4
You can call close() on the input stream. If it is already closed, it will ignore the call.


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