tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Different DelegatingResultSet.getDelegate() between Tomcat 6.0.26 and 6.0.29
Date Tue, 28 Sep 2010 21:13:08 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andreas,

On 9/21/2010 3:00 AM, Andreas Knees wrote:
> I am using Tomcat 6.0.26 under Eclipse 3.6.

[snip]

> Then I switched to use Tomcat 6.0.29. [Now,] DelegatingResultSet
> contains another DelegatingResultSet which again contains the 
> OracleResultSet.

Try reading: http://tomcat.apache.org/tomcat-6.0-doc/changelog.html

Hint: search for "dbcp"

> To save BLOBs with Oracle I have to access the OracleResultSet
> (unfortunately)

I'm not convinced. Why doesn't anyone want to use the Java APIs for blobs?

PreparedStatement ps = conn.prepareStatement("INSERT INTO table
(blobField) VALUES (?)");

ps.setBinaryStream(/* input stream containing by blob */);

ps.executeUpdate();

Want to update a BLOB? How about ResultSet.updateBinaryStream()?

> which I extract as delegate from the
> DelegatingResultSet provided by the connection pool implementation:
> 
> ResultSet rs = stmt.executeQuery();
> org.apache.tomcat.dbcp.dbcp.DelegatingResultSet drs = (DelegatingResultSet) rs;
> OracleResultSet oracleResultSet = (OracleResultSet) drs.getDelegate();

You should be using DelegatingResultSet.getInnermostDelegate().

> Why do these two versions of Tomcat differ so much? I thought that
> the third part of the version (26 or 29) is just a patch level. Why
> do I have to adjust the application code if I migrate to another
> patch level?

It's not documented very well, but you almost always want to use
DelegatingResultSet.getInnermostDelegate. You're right, though: it's
unfortunate that a point release ended up causing code incompatibilities.

I read-through the DBCP changelog, and they don't say anything at all
about a change in behavior from 1.2.2 (old Tomcat DBCP dependency) to 1.3.

Would you care to make a note on the "upgrading" section of the wiki?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyiWmQACgkQ9CaO5/Lv0PD7fQCfTYLOpCSGTinH+0p0aCPWYG48
qvYAnRsu1JiwpQKUllx3kDF1m8WWGU0U
=UQE3
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message