|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Hang while using delete in (?, ?) prepared statement for two nullsHello,
I'm a committer from Apache ODE. We had a hang on derby 10.5.3.0 while we used such prepared statement. We use JTA environment with Tranql and Geronimo embedded, but I think it's not related to this problem. Here's a code to reproduce this hang: { tm.begin(); Connection conn = ((DataSource) getBean("localDerbyDataSource")).getConnection(); Statement s = conn.createStatement(); s.execute("create table test_table (id bigint primary key, v bigint)"); s.execute("insert into test_table values (1,1)"); s.execute("insert into test_table values (2,2)"); s.execute("insert into test_table values (3,3)"); s.execute("insert into test_table values (4,4)"); s.execute("insert into test_table values (5,5)"); s.close(); tm.commit(); } { tm.begin(); Connection conn = ((DataSource) getBean("localDerbyDataSource")).getConnection(); PreparedStatement s = conn.prepareStatement("delete from test_table where id in (?, ?)"); s.setObject(1, null, java.sql.Types.BIGINT); s.setObject(2, null, java.sql.Types.BIGINT); s.execute(); s.close(); tm.commit(); } This statement doesn't make much sense, but we lost a lot of time figuring out what's going on. Alexis Midon found eventually a cause. Is there a chance of fixing it (or at least throwing error on nulls)? FYI, here's an entry in ODE jira: https://issues.apache.org/jira/browse/ODE-671 Regards, -- Rafał Rusin http://www.touk.pl http://top.touk.pl http://people.apache.org/~rr/ |
|
|
Re: Hang while using delete in (?, ?) prepared statement for two nullsRafal Rusin <rafal.rusin@...> writes:
> Hello, > > I'm a committer from Apache ODE. We had a hang on derby 10.5.3.0 while > we used such prepared statement. > We use JTA environment with Tranql and Geronimo embedded, but I think > it's not related to this problem. > > Here's a code to reproduce this hang: > [...] > > This statement doesn't make much sense, but we lost a lot of time > figuring out what's going on. Alexis Midon found eventually a cause. > > Is there a chance of fixing it (or at least throwing error on nulls)? This bug was actually fixed just a couple of weeks ago, see https://issues.apache.org/jira/browse/DERBY-4376. I tried the code you posted, and it does reproduce the hang with Derby 10.5.3.0, but it does not hang when I test it with head of trunk. The fix is also available on the 10.5 branch. > FYI, here's an entry in ODE jira: https://issues.apache.org/jira/browse/ODE-671 I've posted a link to DERBY-4376 on that issue. -- Knut Anders |
|
|
Re: Hang while using delete in (?, ?) prepared statement for two nullsThanks for your answer.
BTW. There's ongoing progress in ODE for migrating from Derby to H2 for embedded database, particularly due to lacking support for MVCC, which raises deadlocks in concurrent scenarios in ODE (https://issues.apache.org/jira/browse/ODE-666). I'm not actually happy of that, because H2 is not so mature project and I'm afraid we could step into precipice. But are going to support MVCC in some future in Derby? BTW 2. Here's a H2 <-> Derby comparison, which may be used for future improvements of Derby: http://www.h2database.com/html/features.html#comparison. 2009/10/8 Knut Anders Hatlen <Knut.Hatlen@...>: > Rafal Rusin <rafal.rusin@...> writes: > >> Hello, >> >> I'm a committer from Apache ODE. We had a hang on derby 10.5.3.0 while >> we used such prepared statement. >> We use JTA environment with Tranql and Geronimo embedded, but I think >> it's not related to this problem. >> >> Here's a code to reproduce this hang: >> > [...] >> >> This statement doesn't make much sense, but we lost a lot of time >> figuring out what's going on. Alexis Midon found eventually a cause. >> >> Is there a chance of fixing it (or at least throwing error on nulls)? > > This bug was actually fixed just a couple of weeks ago, see > https://issues.apache.org/jira/browse/DERBY-4376. I tried the code you > posted, and it does reproduce the hang with Derby 10.5.3.0, but it does > not hang when I test it with head of trunk. The fix is also available on > the 10.5 branch. > >> FYI, here's an entry in ODE jira: https://issues.apache.org/jira/browse/ODE-671 > > I've posted a link to DERBY-4376 on that issue. > > -- > Knut Anders > Regards, -- Rafał Rusin http://www.touk.pl http://top.touk.pl http://people.apache.org/~rr/ |
| Free embeddable forum powered by Nabble | Forum Help |