Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#19 v0.9.0.2 fails to connect to hsqldb, where v0.9.0 works

closed
nobody
None
5
2014-09-20
2005-10-17
Eric Penfold
No

I've noticed a problem, after attempting to upgrade to
c3p0 v0.9.0.2, from v0.9.0.1, which I have been able to
reproduce with the following (trivial) example:

import java.sql.Connection;
import com.mchange.v2.c3p0.ComboPooledDataSource;

public class c3p0test {
public static void main(String[] args) {
try {
ComboPooledDataSource cpds = new
ComboPooledDataSource();
cpds.setDriverClass("org.hsqldb.jdbcDriver");
cpds.setJdbcUrl("jdbc:hsqldb:file:testdb");
cpds.setUser("sa");
cpds.setPassword("");
Connection c = cpds.getConnection();
c.close();
System.out.println("Done!");
}
catch (Exception e) {
System.out.println(e.getMessage());
throw new RuntimeException(e);
}
}
}

Specifically, this appears to occur when attempting to
connect to an HSQLDB database, using 1.8.0.x

With c3p0 v0.9.0, the above example prints "Done!";
with v0.9.0.2, I get the following exception:

java.sql.SQLException: Connections could not be
acquired from the underlying database!
at
com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:104)
at
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:264)
at
com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)
at
com.mchange.v2.c3p0.ComboPooledDataSource.getConnection(ComboPooledDataSource.java:521)
at c3p0test.main(c3p0test.java:14)
Caused by:
com.mchange.v2.resourcepool.CannotAcquireResourceException:
A ResourcePool could not acquire a resource from its
primary factory or source.
at
com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:972)
at
com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)
at
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:260)
... 3 more

Discussion

  • Craig White
    Craig White
    2006-01-02

    Logged In: YES
    user_id=1278456

    I've just run into this too. Thanks for the post as I was
    pulling out my hair.

    I'm using hibernate, with various databases.

    c3p0 0.9.0.2 worked fine with Postgres and Oracle, but
    when I went to switch to hsql (v1.8.0.x), it failed.
    (Similar backtrace). Reverted the jars to 0.9.0 and it
    works.

    Note - it fails to connect to either an 'In process' or
    a 'Server' mode HSQL database.

     
  • Steve Waldman
    Steve Waldman
    2006-01-25

    Logged In: YES
    user_id=175530

    This should be fixed as of c3p0-0.9.0.3. Let me know if you have problems.

     
  • Steve Waldman
    Steve Waldman
    2006-01-25

    • status: open --> closed