-->
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.  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Oracle CLOBs - An approach that may help you
PostPosted: Mon May 24, 2004 9:39 am 
Newbie

Joined: Tue Apr 20, 2004 11:50 am
Posts: 4
I think the problem with Hibernate and Oracle CLOBs is well documented and has caused problems for many people including me. I have read all the postings and other advice in a search for a solution that is elegant and wel encapsulated. The nearest effort is to be found on the Design Patterns page and involves the construction of a CustomType for mapping strings to CLOBS and involves the creation of an Oracle temp CLOB for populating the clob field. This solution was almost perfect except for the fact that it is not possible to free the temp Clob in any convenient way and will cause Oracle to leak resources. In order to address this issue I wrote a class called a TempClobReleaser that has a registerClob static method on it that you must call from your custom type whenever a new temp Clob is created. A thread runs in this class and periodically frees all registered temp clobs at certain time intervals and after the clob has lived in the registry for a certain period of time. Its kind if like a garbage collector I guess. The registry is implemented as a Set and the class has only static methods. This solution clearly is not perfect but does a half decent job of addressing a nasty problem (Oracle's fault not Hibernate's I hasten to add). Here is the code in case it is of any help to anyone. I have hardly tested this so I am not offering any guarantees I just thought it would be better to share an idea like this just in case it helps:

NOTES
PLease ignore the logging its internal proprietary stuff
Sorry for bad formatting I just pasted this in. I am sure you can deal with it

/**
* $RCSfile: $
*
*
* Created : 21-May-2004
* Company :
* Title : Temporary CLOB releaser
*
* -------------------------------------------------------------------------
* Modification History
* -------------------------------------------------------------------------
*
* $Revision: $
* $Author: $
* $Date: $
* $History: $
* $Log: $
*
* --------------------------------------------------------------------------
*/

package ixarc.domain.hibernate.oracle;

import ixp.utils.*;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import oracle.sql.CLOB;

/**
* This class is used by the oracle based clob to string converter for hibernate ORM framework provided in the
* ix toolkit for reading and writing story body data. The type converter is used to get around the shortfalls in the
* Oracle JDBC driver that does not correctly implement JDBC streaming semantics for clob types for data over 4k.
* To get around the issue the type converter (StringClobType) must create a temparory oracle CLOB and stream the
* string data into it before assigning it to the prepared statement. Unfortunately hibernate in its current version
* does not provide an event hook that can execute a procedure when the statement completes and so the tempoary
* clob is never released. For any given Connection (Oracle session) these temporary CLOBS will accululate and use up
* TEMP tablespace. This class is a registry of temp clobs. Each temp clob created in eh converter is registered in this
* class and this class will clean them up at certain intervals. This solution is not a pretty one and not failsafe but
* until eitehr Oracle sort their act out or hibernate supports an event model this is the only acceptable way fo now.
* @author Paul Branscombe
* @version $Revision: $
*/

public class TempClobReleaser
{

/**
* This class represents a CLOB registry entry
* @author Paul Branscombe
* @version $Revision: $
*/
private static class ClobEntry
{
private CLOB m_clob;
private Date m_timestamp;

public void setCLOB(CLOB clob)
{
this.m_clob = clob;
this.m_timestamp = new Date();
}

public CLOB getCLOB()
{
return this.m_clob;
}

public Date getTimeStamp()
{
return this.m_timestamp;
}
}

/**
* This inner class is a thread that checks CLOB entries to see if they have expired. If they have the CLOB
* is freed and the entry removed from the registry.
* @author Paul Branscombe
* @version $Revision: $
*/
private static class ReleaserThread extends Thread
{
private boolean m_stopped = false;

public void Stop()
{
this.m_stopped = true;
}

public void run()
{
while (!this.m_stopped)
{

// Add the enqueued additions to the main registry
TempClobReleaser.m_clobs.addAll(TempClobReleaser.m_enqueuedClobs);
synchronized(TempClobReleaser.m_enqueuedClobs)
{
// Clear the enqueued items now that they have been added to the main registry
TempClobReleaser.m_enqueuedClobs.clear();
}

for (Iterator ii = TempClobReleaser.m_clobs.iterator(); ii.hasNext();)
{

// Get the next entry
ClobEntry entry = (ClobEntry)ii.next();

// Is the entry older than the time to live lifespan. If so then free the clob
// and remove it from the registry
long timeNow = new Date().getTime();
long entryTime = entry.getTimeStamp().getTime();
long differenceInSeconds = (timeNow - entryTime)/1000;

if (differenceInSeconds >= TempClobReleaser.m_lifespan)
{
CLOB clob = entry.getCLOB();
try
{
CLOB.freeTemporary(clob);
TempClobReleaser.m_clobs.remove(entry);
TempClobReleaser.m_logger.LogEvent(0, "Clob Releaser", ILogger.LOG_ERROR, "Clob freed");
}
catch (SQLException e)
{
TempClobReleaser.m_logger.LogEvent(0, "Clob Releaser", ILogger.LOG_ERROR, "Clob free failed: " + e.toString());
}
}
}

try
{
// Wait a bit before starting again
Thread.sleep(TempClobReleaser.m_checkInterval * 1000);
}
catch (InterruptedException e)
{
TempClobReleaser.m_logger.LogEvent(0, "Clob Releaser", ILogger.LOG_ERROR, "Releaser thread interrupted: " + e.toString());
}

}
}
}

/** Releaser checking thread */
private static ReleaserThread m_releaserThread;

/** Application logger instance */
private static ILogger m_logger = new NullLogger();

/** Set of temp clobs current awaiting release */
private static Set m_clobs = new HashSet();

/** Collection for enqueing added clobs whilst release operations are taking place */
private static Set m_enqueuedClobs = new HashSet();

/** CLOB time to live in registry */
private static int m_lifespan = 30;

/** The interval in seconds between checking for expired CLOBs */
private static long m_checkInterval = 30;

/**
* Sets the amount of time that the clob can be in the registry before it is freed
* @param seconds - The time span in seconds
*/
private static void setClobLifeSpan(int seconds)
{
TempClobReleaser.m_lifespan = seconds;
}

/**
* Sets the amount of time that the clob can be in the registry before it is freed
* @param seconds - The time span in seconds
*/
private static void setCheckInterval(int seconds)
{
TempClobReleaser.m_checkInterval = seconds;
}

/**
* Starts the releaser thread running that frees the registered clobs
*/
public static void Start()
{
m_releaserThread = new ReleaserThread();
m_releaserThread.start();
}

/**
* Stops the releaser thread
*/
public static void Stop()
{
m_releaserThread.Stop();
try
{
m_releaserThread.join();
m_releaserThread = null;
}
catch (InterruptedException e)
{
TempClobReleaser.m_logger.LogEvent(0, "Clob Releaser", ILogger.LOG_ERROR, "Thread join error: " + e.toString());
}
}

/**
* registers a temp CLOB in use as awaiting release
* @param clob - The temp CLOB
*/
public static void registerTempCLOB(CLOB clob)
{

// Create a new entry instance to represent the clob being added
ClobEntry entry = new ClobEntry();
entry.setCLOB(clob);

synchronized(TempClobReleaser.m_enqueuedClobs)
{
TempClobReleaser.m_enqueuedClobs.add(entry);
}
}

}


Code that uses the class:
This is my implementation of the String to CLOB custom type that works with connection pooling that produces proxies that would normally prevent access to the underlying Oracle connection object. As I have posted before, the metadata seems to allow access in these cases and I have been able to continues using C3P0 connection pooling. The is modified from a sample taken from this site so most credit goes to the original author. I have removed the refection stuff to make the code more readable and maintainable which is fine where an Oracle build time dependancy is not a problem.

/**
* $RCSfile: StringClobType.java $
*
* All Rights Reserved.
*
* Created : 30-April-2004
* Company :
* Title : Clob to String Type Hibernate Converter
*
* -------------------------------------------------------------------------
* Modification History
* -------------------------------------------------------------------------
*
* $Revision: $
* $Author: $
* $Date: $
* $History: $
* $Log: $
*
* --------------------------------------------------------------------------
*/

package ixarc.domain.hibernate.oracle;

import oracle.sql.CLOB;
import java.io.*;
import java.lang.reflect.*;
import java.sql.*;

import org.apache.commons.lang.*;
import net.sf.hibernate.*;

/**
* Based on community area design patterns on Hibernate site.
* Maps java.sql.Clob to a String special casing for Oracle drivers.
*
* This class is used in teh Hibernate ORM environment to map entity based String type properties
* to Oracle CLOB type columns and to hide the implementation from the domain entity classes. This
* implementation works specifically with Oracle 9i and can be used in a hibernate mapping only when
* this is the target database. For other target databases a different UserType implementation should
* be specified. This implementation differs from the one from the community site in that I have decided
* not to used reflection to get instances of the Oracle classes and invoke methods on them just to
* prevent needed the Oracle driver at build time. This class should be built in an implementation
* specific project away from the main data access framework. This make the code much easier to read.
* Also have added comments javadocs and refactored code to be more readable and intuitive
* @author Ali Ibrahim, Scott Miller, Paul Branscombe
* @version $Revision: $
*/
public class StringClobType implements UserType
{

/** Name of the oracle driver -- used to support Oracle clobs as a special case */
private static final String ORACLE_DRIVER_NAME = "Oracle JDBC driver";

/** Version of the oracle driver being supported with clob. */
private static final int ORACLE_DRIVER_MAJOR_VERSION = 9;
private static final int ORACLE_DRIVER_MINOR_VERSION = 0;

/**
* Return the SQL type of the column that this instance is converting to a java String
* @return - The CLOB type as the only array element
*/
public int[] sqlTypes()
{
return new int[] {Types.CLOB};
}

/**
* The class of object that we this class will return. The class of object we are converting to in other
* words.
* @return The String class
*/
public Class returnedClass()
{
return String.class;
}

/**
* Compare two instances of the class mapped by this type for persistence "equality".
* @param x
* @param y
* @return - true if both object values are the same
*/
public boolean equals(Object x, Object y)
{
return ObjectUtils.equals(x, y);
}

/**
* Gets the string value of the Clob column. For argument details see Hibernate Javadocs
* @param rs - The ResultSet containing the row that contains the column to be converted
* @param names - The name of the column to be converted
* @param owner - See Hibernate documentation
* @return - String containing the CLOB contents
* @throws HibernateException
* @throws SQLException
*/
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException
{

String columnName = names[0];

// Get the clob field we are interested in from the result set
Clob textClob = rs.getClob(columnName);
String clobText = textClob.getSubString(1, (int)textClob.length());

return clobText;

}

/**
* Sets the contents of the specified CLOB column using the value provided. This should be a java String
* @param st - The JDBC PreparedStatement performing the update or insert
* @param value - The String value to set in the CLOB column
* @param index - The index of the value param in the prepared statement
* @throws HibernateException
* @throws SQLException
*/
public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException
{
// Here we just want to make a check to make sure that we have the right version of the JDBC driver for
// Oracle. Versions older the 9.x will not work this way
DatabaseMetaData dbMetaData = st.getConnection().getMetaData();

// If the inserted value is null juct set the paramater to null and we are done.
if (value == null)
{
st.setNull(index, sqlTypes()[0]);
}

// If the driver reported by the JDBC driver is the one we need then we can continue
else if (ORACLE_DRIVER_NAME.equals(dbMetaData.getDriverName()))
{
// If we have a driver that has teh same or later version than the one required then we can
// continue
if ( (dbMetaData.getDriverMajorVersion() >= ORACLE_DRIVER_MAJOR_VERSION) && (dbMetaData.getDriverMinorVersion() >= ORACLE_DRIVER_MINOR_VERSION))
{

try
{

// Get the connection in use and make sure it is an OracleConnection
Connection conn = dbMetaData.getConnection();

if (!(conn instanceof oracle.jdbc.driver.OracleConnection))
{
throw new HibernateException("JDBC connection object must be a oracle.jdbc.driver.OracleConnection. " +
"Connection class is " + conn.getClass().getName());
}

// Create a temporary CLOB using the Oracle CLOB class
CLOB tempClob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);

// Add the temp clob to the clob releaser registry so that it will be freed
TempClobReleaser.registerTempCLOB(tempClob);

// Open the CLOB for read write
tempClob.open(CLOB.MODE_READWRITE);

// Get the character output stream so tha we can write our string to it
Writer tempClobWriter = tempClob.getCharacterOutputStream();

// write the string to the clob
tempClobWriter.write( (String) value);
tempClobWriter.flush();
tempClobWriter.close();

// get the close method
tempClob.close();

// add the clob to the statement
st.setClob(index, (Clob)tempClob);
}
catch (IOException e)
{
throw new HibernateException(e.getMessage());
}
}
else
{
throw new HibernateException("No CLOBS support. Use driver version " + ORACLE_DRIVER_MAJOR_VERSION +
", minor " + ORACLE_DRIVER_MINOR_VERSION);
}
}
else
{
String str = (String) value;
StringReader r = new StringReader(str);
st.setCharacterStream(index, r, str.length());
}
}

public Object deepCopy(Object value)
{
if (value == null)
{
return null;
}
return new String( (String) value);
}

public boolean isMutable()
{
return false;
}
}


Hope this helps until we get a hibernate event model and/or Oracle sort their lives out.

Cheers

Paul Branscombe


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 09, 2004 6:32 pm 
Regular
Regular

Joined: Fri Dec 12, 2003 2:09 pm
Posts: 84
Location: San Francisco, USA
Thanks for this contribution -- we are planning to implement something very similar.

We have built a wrapper for Hibernate Sessions, and plan to place this functionality within the wrapper. The wrapper would automatically release "registered" temporary LOBs before the Session is committed or rolled back, so we won't to periodically poll for LOBs to free.

Out of curiosity, have you looked into what happens to temporary LOBs when transactions fail/rollback? Do they still need to be freed?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 10, 2004 4:11 am 
Newbie

Joined: Tue Apr 20, 2004 11:50 am
Posts: 4
Thanks for the reply. Your solution sounds much neater and cleaner than mine. I may take a look at implementing your own approach when I get back to that project. I have no idea what happens to temp LOBs when txS fail. I would imagine it makes no difference given that these objects are always created and freed manually. My wish would be for Oracle to address this issue and implement something a little more friendly and, dare I say, up to date. Thanks again for your feedback it is much appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 10, 2004 12:35 pm 
Regular
Regular

Joined: Fri Dec 12, 2003 2:09 pm
Posts: 84
Location: San Francisco, USA
You're most welcome.

Oracle makes developers go through absurd hoops when using JDBC. Bastards! ;>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 05, 2004 3:10 pm 
Newbie

Joined: Wed Sep 24, 2003 12:14 pm
Posts: 16
Location: Brazil
Hi Paul,

Thanks for your code...we're having this kind of problem and you seem to be the most expert in this area!

We're trying to reproduce your approach but our connection type (from dbMetaData.getConnection()) is "oracle.jdbc.driver.T4CConnection".

Error message:
JDBC connection object must be a oracle.jdbc.driver.OracleConnection. Connection class is oracle.jdbc.driver.T4CConnection

We're using Oracle 10g and Tomcat with DBCP pool.

Any ideas?

Thanks again

Paulo

_________________
Paulo Alvim
Powerlogic - Brazil


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 05, 2004 3:49 pm 
Newbie

Joined: Tue Apr 20, 2004 11:50 am
Posts: 4
Hi Alvim

I would have looked into this for you but I am under a lot of pressure to get a release out and am too busy. However I think you can solve this with some logical deduction. My guess is that the T4CConnection is a connection implementation that is produced by the JDBC driver you are using. I assume it is not the thin driver (in classes12.jar probably) that I am using but I am not sure what driver it is. Anyhow, you might find that you can alter the code I provided to allow T4CConnection as well as OracleConnection. Or you might try using a different JDBC driver if that does not work. Sorry I could not help more right now. If you are still having problems please post again and I may find some more time in the very near future.

cheers

Paul


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 05, 2004 4:11 pm 
Newbie

Joined: Wed Sep 24, 2003 12:14 pm
Posts: 16
Location: Brazil
Thanks Paul,

We're using the "ojdbc14.jar" from oracle 10 distribution which is recommended for jre 1.4.x.

We could change to class12 again but we've just getting it working using the "wrapper" approach given by "imario".
See
http://forum.hibernate.org/viewtopic.php?t=929695&highlight=clob

But we don't know if "imario" has notice about the memory leaking issue. We'll try to post with him to get this information.

Thanks a lot!

Paulo

_________________
Paulo Alvim
Powerlogic - Brazil


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 05, 2004 9:23 pm 
Regular
Regular

Joined: Fri Dec 12, 2003 2:09 pm
Posts: 84
Location: San Francisco, USA
Personally, I think it's cleaner to implement a custom UserType to handle Oracle LOBs. For instance, we created a custom type that maps any Serializable object into an XML string that is stored as an Oracle CLOB, using the XMLEncoder included with the JDK. This is a nice, generic way to map a complex Java object structure into a single column.

See the community area for more on this user type pattern.


Top
 Profile  
 
 Post subject: Oracle and clobs on10g
PostPosted: Wed Jul 07, 2004 7:55 am 
Newbie

Joined: Mon Mar 29, 2004 9:01 pm
Posts: 3
Is this method still necessary for the people using 10g, given this sample code:
http://otn.oracle.com/sample_code/tech/ ... .java.html

setString and getString could work with data >32K, with an additional property setting, and <32K normally, has anyone tried this code yet?

i only looking to support clobs <32K, so starting with the easiest option, I tried the code for a smal file, it successfully inserted it <4K of data but fails on selecting it out, which i'm hoping is something wrong with my environment.

If I get that sorted out and the code works then I should hopefully be able to try it out with hibernate, without the use of a UserType.

Has anyone else checked out that sample code and latest 10g drivers?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 30, 2005 9:52 am 
Newbie

Joined: Tue May 03, 2005 3:18 pm
Posts: 9
Not sure how much this will help, as I've yet to try it with Hibernate, but we've used another JDBC driver other than the standard Oracle, and it circumvents the whole 4000 byte issue (at least with entity beans). It might help.... Anyway, even if it doesn't help with this issue, it certainly was a lot faster than the standard Oracle driver, and it's fully JDBC 3.0 compliant. Check it out:

http://www.inetsoftware.de/products/jdbc/oracle/oranxo/

We've also used another of their drivers (Merlia), which is for SQLServer, and that one blew the Microsoft driver out of the water. We were experiencing memory issues, and all sorts of bottlenecks when retrieving data from the database with the MS driver, and Merlia cleared it up. And no, I don't work for them, just trying to save people some frustration.

Good luck.

Raj


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 20, 2005 4:09 pm 
Senior
Senior

Joined: Wed Jul 13, 2005 4:31 pm
Posts: 142
Location: Seattle, WA
We are using the CLOB to String in the oracle 10g driver.

But, we just found a memory leak with it.

Turns out that the driver is allocating huge amount (64k) memory for the string buffer to put the CLOB string in. But, when it returns the string using toString(), the memory is not shrunk based on the size of the actual string being returned. So,even if the string actually only has 30 characters, it still takes up 64k. For us, this results in out of memory exception when loading about 1000 objects containing string properties which are stored as CLOBs in oracle.

It took us a while to find out why we couldn't handle not-that-large a dataset. For the most part we spent time trying to optimize our usage of hibernate. After much testing with large datasets, turned out its a bug/feature of java and oracle 10g driver.

Now that we know...we can workaround it by doing a new String(clobString) if we intend to keep around a reference to the string returned by the oracle driver. Constructing the new String reallocates the memory to be the size of the actual string rather than the buffer.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 13, 2007 2:33 pm 
Newbie

Joined: Tue Feb 13, 2007 1:31 pm
Posts: 5
I am using the Hibernate's own StringClobType and wanted to know if this problem still persists or has Hibernate taken care of it in some way?

Thanks
Manish


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 22, 2007 3:52 pm 
Newbie

Joined: Mon Mar 19, 2007 5:28 pm
Posts: 6
Hi Paul Branscombe,

I tried to use your approach to retrieve the value of the CLOB. I am using ojdbc14-9.0.2.0.jar, Oracle 9i, Spring 2.0.2, Hibernate 3.2.2. I am getting null pointer exception. I am attaching the stack trace..... Could you please let me know if I am doing something wrong when using your class....

Thanks
-Salini

Exception in thread "main" java.lang.NullPointerException
at com.fxfn.misp.dto.StringClobType.nullSafeGet(StringClobType.java:93)
at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:105)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2092)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1371)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1299)
at org.hibernate.loader.Loader.getRow(Loader.java:1197)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:568)
at org.hibernate.loader.Loader.doQuery(Loader.java:689)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1851)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3038)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:179)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:465)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:459)
at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:453)
at com.fxfn.misp.dao.hibernate.HibernateSQLReportDAO.find(HibernateSQLReportDAO.java:20)
at com.fxfn.newgen.test.HibernateDbApp.main(HibernateDbApp.java:94)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 22, 2007 4:30 pm 
Newbie

Joined: Tue Feb 13, 2007 1:31 pm
Posts: 5
Why are you still applying the custom solution?

Hibernate (3.0?) provides org.hibernate.type.StringClobType that you can use for String to Clob and vice-a-versa conversion.

Add following entry to Typedefs.xml

<typedef class="org.hibernate.type.StringClobType" name="stringClobType"/>

and define this custom type in your hibernate mapping files for any string property that you want to be stored as CLOB.

I ran a Unit Test and tried to store more than 4000 characters for the property defined as stringClobType and it worked just fine.

Manish


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 23, 2007 11:35 am 
Newbie

Joined: Mon Mar 19, 2007 5:28 pm
Posts: 6
Hi Manish,

Can you please send me an example if you have one with the <typedef> defined in TypeDefs.xml.

Thanks
-Salini


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 23 posts ]  Go to page 1, 2  Next

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.