PiRSquared17 / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

bug with running the same CallableStatement twice when calling close() #538

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I already sent quetion to  H2 Google Group 
(https://groups.google.com/forum/#!topic/h2-database/kVpREWoWSaU) - no responce

Problem with error during CallBackStatement execution

1) https://gist.github.com/Manjago/8122598 -  fail with output 
https://gist.github.com/Manjago/8122610 
2) https://gist.github.com/Manjago/8122632 - success

I use h2database engine from maven

<dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <version>1.3.174</version>
</dependency>

, I use java

java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

Original issue reported on code.google.com by kirill.t...@gmail.com on 28 Dec 2013 at 6:31

GoogleCodeExporter commented 9 years ago
A simpler test case:

I can now reproduce the problem. My test case is a bit simpler:

    Connection conn = DriverManager.getConnection("jdbc:h2:mem:");
    conn.createStatement().execute(
            "create table test(id identity) as select null");
    for (int i = 1; i < 20; i++) {
        System.out.println("i=" + i);
        CallableStatement cs = conn.prepareCall(
                "{ ? = call IDENTITY()}");
        cs.registerOutParameter(1, Types.BIGINT);
        cs.execute();
        long id = cs.getLong(1);
        System.out.println("> id = " + id);
        cs.close();
    }

Original comment by thomas.t...@gmail.com on 28 Dec 2013 at 9:47

GoogleCodeExporter commented 9 years ago
Should be fixed in the trunk.

Original comment by thomas.t...@gmail.com on 29 Dec 2013 at 9:05

GoogleCodeExporter commented 9 years ago
Fixed in version 1.3.175

Original comment by thomas.t...@gmail.com on 18 Jan 2014 at 6:17