Unfortunately due to the CacheLoader startup also being busted I haven't been 
able to do any testing of 1.2.4beta with jboss4.0.2. I tried moving the code 
from createService back to startService as noted in this jira: 
http://jira.jboss.com/jira/browse/JBCACHE-303

Then I started getting NPEs on startup. I was going to look into it further 
until we discovered a data corruption problem that effects JBossCache 1.2.3 and 
1.2.4beta (and likely most older releases) when using MySQLs driver for the 
JDBC CacheLoader. (we tried both their latest 3.0.x and 3.1.x connectors)

The problem really isn't with your code. It's with MySQL not properly 
implementing the methods: .getBinaryStream and .setBinaryStream.

The problem with these methods in the MySQL connector is that they only stream 
the byte array up to about 4k. So on insert anything longer than 4k gets 
truncated to 4k and inserted (your insertNode and updateNode are effected) 
without any warning or exception!!! This in turn corrupts the entire table (and 
our cache) and causes .getBinaryStream calls (in your case loadNode) to get 
corrupted garbage!!

The worst part is MySQL has had postings and complaints about this issue for at 
least 3 years and never fixed it. (The oracle driver had the same exact issue 
with these methods for two years as well. I haven't used Oracle in the past 
year so they may have fixed it. But I doubt it.)

Of course you could write your own streaming code but when you get into writing 
your own JDBC totally falls apart as you are then subjected to each vendors 
specific implementation classes for Blob. (if they even have such a thing) :P

In our usage we have two cache loaders one that uses Hypersonic and one that 
uses MySQL. Luckily we did find a fix that works for both but I'm pretty sure 
it won't work for Oracle. Our fix was to use .setObject and .getObject. These 
stream perfectly for the MySQL and Hypersonic drivers! (but it did not properly 
stream with Oracle when we tried it a year ago)

Also For Hypersonic it requires you set cache.jdbc.node.type=OBJECT
in your cacheloader configuration.

I can email you our modified version of JDBCCache loader if you guys want to 
test it in oracle... Maybe it works now.

If not then I really am at a loss for how to fix this and strick to straight 
JDBC as every vendor seems hell bent on claiming JDBC compliance and then 
leaves critical methods like these either silently busted or unimplemented 
entirely.

Also where is the jbosscache 1.2.3 tag in cvs? I found a tag for every version 
except 1.2.3 (we're pointed at your new cvs server) so we had to apply the fix 
to the HEAD then grab the compiled JDBCCacheLoader class and shove it into the 
1.2.3 jar. Anyway it works now for us :) Wish I had a universal fix to give ya.

Hopefully this has been mostly informative and minimal rant. ;)

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3899328#3899328

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3899328


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to