Question

Hi i'm trying to create a blob with hibernate like this, i can't use Hibernate.getBlobCreator because i don't know the length of the stream

final Session currentSession = sessionFactory.getCurrentSession();
currentSession.doWork(new Work() {
    @Override
    public void execute(Connection connection) throws SQLException {
        connection.createBlob();
    }   
});

"createBlob" gives me an "AbstractMethodError".

java.lang.AbstractMethodError: com.mchange.v2.c3p0.impl.NewProxyConnection.createBlob()Ljava/sql/Blob;

but connection is of type "com.mchange.v2.c3p0.impl.NewProxyConnection@26561d65", which has implemented this function, how can it be?

Was it helpful?

Solution

c3p0 up to version 0.9.2.x only supports JDBC3 API. You are calling a JDBC4 method. The easiest solution is to upgrade to c3p0-0.9.5-pre5 (which, while still a prerelease, is pretty solid).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top