> I'm pretty > sure this won't work for some db's. I know it won't work in > Oracle due > to their JDBC drivers. Here's a summary of my discoveries: > > 1) I was under the impression that I could just use my own Clob > implementation and call PreparedStatement.setClob. > Unfortunately, this > is not the case. Oracle JDBC will throw a ClassCastException if it > doesn't get an oracle.sql.CLOB. Furthermore, to save a CLOB for the > first time, the row needs to be created first, then you need > to select > the Clob object, and then finally you can write the data out > to the db. > This means that CLOB support is not going to be as simple as > providing a > ClobType.
Yes, I already discovered this! (Oracle is the only sticking point with this approach, btw. Other drivers don't mind. But you didn't read my post properly. This is NOT how I am going to do it! The object passed to ClobType only implements Clob from the purposes of being useable in the persistent class. ClobType actually looks at it, figures out its a wrapper and calls setString(). > 2) In order to write to a Clob, it must first be retrieved > with a SELECT > .... FOR UPDATE statement, which means that we'd have to fool > around with > locking when writing Clobs. I havn't noticed this myself. In fact my tests havn't shown this to be a problem. Anyway, it is already possible to do select for update in Hibernate, by using LockMode.UPGRADE. We might have to extend that functionality just a little bit, if it turns out that you are correct. But this is certainly not insurmountable. > Something else just occurred to me: supporting Clobs and > Blobs in long > transactions will get pretty tricky. Make that "virtually impossible". There will be many restrictions upon how you can use objects with Blob or Clob properties. > P/S - If you haven't already written your own ClobImpl, I can > send you > what I have as a starting point. Yes please! I had something *really* simple but threw it away after initially testing its feasibility. ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** ------------------------------------------------------- This SF.NET email is sponsored by: The Best Geek Holiday Gifts! Time is running out! Thinkgeek.com has the coolest gifts for your favorite geek. Let your fingers do the typing. Visit Now. T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel