SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye
Issue Details (XML | Word | Printable)

Key: CMP-380
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Shay Banon
Reporter: Arne Bultman
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Compass

JdbcDirectory: FetchPerTransactionJdbcIndexInput blob caching broken

Created: 08/Mar/07 10:33 AM   Updated: 16/May/07 07:44 PM
Component/s: None
Affects Version/s: 1.1 GA
Fix Version/s: 1.2 M1


 Description  « Hide
When using the Spring TransactionAwareDatasource to wrap connections to the database for transactional security, the FetchPerTransactionJdbcIndexInput.bindBlob and getBoundBlob are broken. The reason is that the connections returned are all ConnectionProxy instances. The caching seems to even return cached blobs from differenct connections sometimes which causes rather nasty blob exceptions. If fixed the problem by creating a local build with a modified DataSourceUtils.getTargetConnection() which also takes spring connectionproxies into account, however this is probably not the best solution because of the spring dependency this introduces.

    public static Connection getTargetConnection(Connection conn) {
        if (conn instanceof ConnectionProxy ) {
            return ((ConnectionProxy) conn).getTargetConnection();
        }
        // We need to do the same for spring based ConnectionProxy, or the same error will occur:
        if (conn instanceof org.springframework.jdbc.datasource.ConnectionProxy) {
            return ((org.springframework.jdbc.datasource.ConnectionProxy)conn).getTargetConnection();
        }
        return conn;
    }

BTW: I've not assigned it to any component because there is no separate JdbcDirectory component.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Shay Banon added a comment - 21/Apr/07 04:02 PM
I have added checks for Spring ConnectionProxy as well using reflection. Not the nicest solution, since the best one would be to have the ability for a pluggable native connection extractor. Just so things will work for now.

Can you please verify that this works with the latest M1 snapshot?

Arne Bultman added a comment - 26/Apr/07 06:50 AM
I'll look in to it next week. Thanks for fixing.

Arne Bultman added a comment - 08/May/07 10:09 AM
I'm sorry but I cannot validate that this is fixed. The 1.2 version seems to have a dependency on lucene 2.1 which we're not quite ready to use.

Justin Daly added a comment - 16/May/07 07:17 PM
not working in M2-SNAPSHOT as of today, reopening

Justin Daly added a comment - 16/May/07 07:44 PM