邢岩 wrote: > { > Session session = openSession(); > try { > String content = article.getContent(); > article.setContentClob(Hibernate.createClob(" ")); > session.update(article); > session.flush(); > session.refresh(article, LockMode.UPGRADE); > /**************************************/ > CLOB clob = (CLOB)article.getContentClob(); a > ClassCastException will be thrown here!
> I will got a classcastexception, this problem has puzzled me one day, can > somebody give me some advices about this problem? Thanks very much! > > Hmmm, are you using your code in some application server or web server? This may be related to class loader problems. What is the result of article.getContentClob().GetType().ToString()? If it is the exact name of CLOB class so for sure is a class loader problem, because since a version of j2sdk or j2ee spec, I don't remember, the class loader is also part of the class name and if the same class come from different class loaders they are handled as different classes and will give you classcastexcpetions in runtime. I hope it helps. Regards, Francisco Figueiredo Jr. ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel