Thread:
 Temporary Clob Resource Leak 
 rgodfrey   10 Oct 2003, 16:05 
 Re: Temporary Clob Resource Leak 
 rgodfrey   14 Oct 2003, 13:07 
 Re: Temporary Clob Resource Leak 
 bd   07 Nov 2003, 11:36 
 Re: Temporary Clob Resource Leak 
 yvanhess   05 Dec 2003, 16:21 
 Re: Temporary Clob Resource Leak 
 bd   13 Dec 2003, 16:17 
 Re: Temporary Clob Resource Leak 
 bd   17 Dec 2003, 10:49 
 Re: Temporary Clob Resource Leak 
 neil_g_avery   07 Jan 2004, 11:03 
 Re: Temporary Clob Resource Lea... 
 bd   30 Jan 2004, 14:43 
 Re: Temporary Clob Resource ... 
 Kai   02 Mar 2004, 17:22 
 Re: Temporary Clob Resour... 
 hypernate   11 Mar 2004, 22:34 
 Re: Temporary Clob Reso... 
 telebears   08 Dec 2004, 19:05 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: neil_g_avery (07 Jan 2004, 11:03) Replies: 4, Views: 38930
Subject: Re: Temporary Clob Resource Leak
This still feels like a messy hack to get around oracle shortcomings
that means hibernate or the developer code has to jump through hoops.
From a point of cleanliness it would be prefereble to not have to resort
to a JTA callback and then be able to hide freeTemp call through an
upcoming hibernate callback api (as previously mentioned).

The problem comes down to the issues of obtaining a clob/blob pointer
into the DB which the oracle jdbc driver provides 2 mechanisms for - 
1) either through a ResultSet or Statement (non-prep) executing and
interrogating the resultset.
2) or using a temporary Clob - which is simpler and less intruisive
however hits you with the overhead of resorting to callbacks to free the
temp storage.

(apologies for stating the obvious)

Would it be possible to code scenario 1) as implied below ? - and hide
that code in the user defined type? This means we need a reference to
the session and current object we are trying to persist.

<<snip>>
foo = new Foo();
foo.setClob( Hibernate.createClob(" ") );
s.save(foo);
s.flush();
s.refresh(foo, LockMode.UPGRADE); //grabs an Oracle CLOB
oracle.sql.CLOB clob = (oracle.sql.CLOB) foo.getClob();
java.io.Writer pw = clob.getCharacterOutputStream();
<<snip>>
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]