[h2] java.lang.NoClassDefFoundError: org/h2/command/dml/SetClauseList

2024-04-04 Thread Martin Lichtin
Seeing this NoClassDefFoundError, looks like it's from the Server side.
Anyone has an idea? H2 version 2.2.224

Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: 
"java.lang.NoClassDefFoundError: 
org/h2/command/dml/SetClauseList" [5-224] at 
org.h2.message.DbException.getJdbcSQLException(DbException.java:566) ~[?:?] 
at org.h2.engine.SessionRemote.readException(SessionRemote.java:650) ~[?:?] 
at org.h2.engine.SessionRemote.done(SessionRemote.java:619) ~[?:?] at 
org.h2.command.CommandRemote.prepare(CommandRemote.java:78) ~[?:?] at 
org.h2.command.CommandRemote.(CommandRemote.java:50) ~[?:?] at 
org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:487) ~[?:?] 
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1166) 
~[?:?] at 
org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:93) 
~[?:?] at 
org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:316) ~[?:?] 

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/8a8d12f2-c07c-49b9-bf93-71dade9e37f3n%40googlegroups.com.


[h2] XA commit-unlockAll - Unexpected code path

2018-04-13 Thread Martin Lichtin
Seeing following exception after upgrading from 196 to 197:

Caused by: org.h2.jdbc.JdbcSQLException: General error: 
"java.lang.RuntimeException: Unexpected code path"; SQL statement:
COMMIT TRANSACTION 
XID_1096044365_3139322e3136382e35362e312e746d31343531_33626532396263332d613865662d343861382d616466352d313433386261336163303838
 
[5-197]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:307)
at org.h2.command.Command.executeUpdate(Command.java:274)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:399)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:165)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Unexpected code path
at org.h2.message.DbException.throwInternalError(DbException.java:254)
at org.h2.message.DbException.throwInternalError(DbException.java:267)
at org.h2.engine.Session.unlockAll(Session.java:985)
at org.h2.engine.Session.endTransaction(Session.java:760)
at org.h2.engine.Session.commit(Session.java:708)
at org.h2.engine.Session.setPreparedTransaction(Session.java:1179)
at 
org.h2.command.dml.TransactionCommand.update(TransactionCommand.java:70)
at org.h2.command.CommandContainer.update(CommandContainer.java:102)
at org.h2.command.Command.executeUpdate(Command.java:261)
... 3 more

at 
org.h2.engine.SessionRemote.done(SessionRemote.java:623)[182:org.h2:1.4.197]
at 
org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:237)[182:org.h2:1.4.197]
at 
org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:233)[182:org.h2:1.4.197]
at 
org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:205)[182:org.h2:1.4.197]
at 
org.h2.jdbcx.JdbcXAConnection.commit(JdbcXAConnection.java:349)[182:org.h2:1.4.197]
... 27 more

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] How to execute SQL commands from standard input

2018-03-28 Thread Martin Lichtin
Is there a way using either Shell or RunScript to execute SQL commands 
coming from standard input?

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Timeout trying to lock table: Caused by .. Concurrent update in table "MY_TABLE": another transaction has updated or deleted the same row

2016-06-14 Thread Martin Lichtin
Ok, but there should be no concurrent updates in my use case.
I'm using SELECT ... FOR UPDATE to lock a row, then UPDATE the row, then 
COMMIT the transaction, at which point another ...FOR UPDATE session gets 
access to the row.

On Thursday, June 2, 2016 at 7:50:47 AM UTC+2, Thomas Mueller Graf wrote:
>
> Hi,
>
> On a concurrent update, the statement (just the statement, not the whole 
> transaction) is rolled back and re-run. This is done a few times, and after 
> some time (the configured timeout), the "timeout" exception is thrown.
>
> Regards,
> Thomas
>
>
> On Tuesday, May 31, 2016, Martin Lichtin <mlic...@gmail.com > 
> wrote:
>
>> We're sometimes seeing this exception when doing SELECT .. FOR UPDATE 
>> concurrently .
>>
>> Caused by: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table ; 
>> SQL statement:
>> SELECT * FROM SA.MY_TABLE WHERE MY_ID = ? FOR UPDATE [50200-191]
>> at org.h2.message.DbException.getJdbcSQLException(DbException.java:
>> 345)
>> at org.h2.message.DbException.get(DbException.java:168)
>> at org.h2.command.Command.filterConcurrentUpdate(Command.java:307)
>> at org.h2.command.Command.executeQuery(Command.java:203)
>> at org.h2.server.TcpServerThread.process(TcpServerThread.java:320)
>> at org.h2.server.TcpServerThread.run(TcpServerThread.java:159)
>> at java.lang.Thread.run(Thread.java:745)
>> Caused by: org.h2.jdbc.JdbcSQLException: Concurrent update in table 
>> "MY_TABLE": another transaction has updated or deleted the same row [
>> 90131-191]
>> at org.h2.message.DbException.getJdbcSQLException(DbException.java:
>> 345)
>> at org.h2.message.DbException.get(DbException.java:179)
>> at org.h2.message.DbException.get(DbException.java:155)
>> at org.h2.table.RegularTable.removeRow(RegularTable.java:374)
>> at org.h2.table.TableFilter.lockRows(TableFilter.java:1147)
>> at org.h2.command.dml.Select.queryFlat(Select.java:565)
>> at org.h2.command.dml.Select.queryWithoutCache(Select.java:654)
>> at org.h2.command.dml.Query.query(Query.java:341)
>> at org.h2.command.dml.Query.query(Query.java:309)
>> at org.h2.command.dml.Query.query(Query.java:36)
>> at org.h2.command.CommandContainer.query(CommandContainer.java:110)
>> at org.h2.command.Command.executeQuery(Command.java:201)
>> ... 3 more
>>
>> at org.h2.engine.SessionRemote.done(SessionRemote.java:624)
>> at org.h2.command.CommandRemote.executeQuery(CommandRemote.java:158)
>> at org.h2.jdbc.JdbcPreparedStatement.executeQuery(
>> JdbcPreparedStatement.java:110)
>>
>> What's a bit confusing, is this a really a timeout situation, or 
>> something different as the 'caused by' exception would indicate?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Timeout trying to lock table: Caused by .. Concurrent update in table "MY_TABLE": another transaction has updated or deleted the same row

2016-05-31 Thread Martin Lichtin
We're sometimes seeing this exception when doing SELECT .. FOR UPDATE 
concurrently .

Caused by: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table ; SQL 
statement:
SELECT * FROM SA.MY_TABLE WHERE MY_ID = ? FOR UPDATE [50200-191]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.command.Command.filterConcurrentUpdate(Command.java:307)
at org.h2.command.Command.executeQuery(Command.java:203)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:320)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:159)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.h2.jdbc.JdbcSQLException: Concurrent update in table 
"MY_TABLE": another transaction has updated or deleted the same row [90131-
191]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.table.RegularTable.removeRow(RegularTable.java:374)
at org.h2.table.TableFilter.lockRows(TableFilter.java:1147)
at org.h2.command.dml.Select.queryFlat(Select.java:565)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:654)
at org.h2.command.dml.Query.query(Query.java:341)
at org.h2.command.dml.Query.query(Query.java:309)
at org.h2.command.dml.Query.query(Query.java:36)
at org.h2.command.CommandContainer.query(CommandContainer.java:110)
at org.h2.command.Command.executeQuery(Command.java:201)
... 3 more

at org.h2.engine.SessionRemote.done(SessionRemote.java:624)
at org.h2.command.CommandRemote.executeQuery(CommandRemote.java:158)
at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.
java:110)

What's a bit confusing, is this a really a timeout situation, or something 
different as the 'caused by' exception would indicate?

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] SELECT.. FOR UPDATE (to lock a row) followed by closing the connection leaves the row lock around

2016-01-28 Thread Martin Lichtin
That was fast, thanks Noel.
In the mean time however I'm no longer so certain about my observation :)
As I use connection pooling, doesn't the close() become a no-op (it never 
reaches the H2 server).
So I still need either a commit or rollback to complete the transaction 
before returning the connection back to the pool...

On Thursday, January 28, 2016 at 9:38:28 AM UTC+1, Noel Grandin wrote:
>
> thanks for the bug report, this has been fixed on master/trunk 
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] SELECT.. FOR UPDATE (to lock a row) followed by closing the connection leaves the row lock around

2016-01-26 Thread Martin Lichtin
As the subject says, I'm doing a SELECT.. FOR UPDATE to lock a row.

Sometimes this is followed by an UPDATE, sometimes not. 
In the case of an UPDATE, I commit() the connection which releases the 
lock. All fine.

When not updating the row contents, I close() the connection. This however 
seems to leave the row lock around.
I can, also in this case, call either commit() or rollback() before the 
close(), then the lock is released.
But why would I be required to do this? Closing a connection (whether 
voluntarily or due to a networking issue) should cleanup its resources as 
well (e.g. locks).

- Martin

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Re: NPE when shutting H2 down after integration tests run

2013-06-03 Thread Martin Lichtin
Yeah, you're right. I already updated the version, but the stack indeed 
came from 1.3.170.

On Monday, June 3, 2013 8:58:13 AM UTC+2, Kartweel wrote:

  The stack trace indicates version 1.3.170 ?


-- 
You received this message because you are subscribed to the Google Groups H2 
Database group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [h2] Re: NPE when shutting H2 down after integration tests run

2013-06-03 Thread Martin Lichtin
Can't say yet, I am in the process of upgrading to 1.3.172. But there is a 
new OSGi dependency, I am getting:

Caused by: org.osgi.framework.BundleException: Unresolved constraint in 
bundle org.h2 [71]: Unable to resolve 71.0: missing requirement [71.0] 
osgi.wiring.package; 
((osgi.wiring.package=org.osgi.service.jdbc)(version=1.0.0))

Need to figure this one out first...

On Monday, June 3, 2013 9:27:02 AM UTC+2, Kartweel wrote:

  Sorry, so do you mean you are still getting a very similar stack in 
 1.3.172?, You just don't have a record of it?

 On 3/06/2013 3:12 PM, Martin Lichtin wrote:
  
 Yeah, you're right. I already updated the version, but the stack indeed 
 came from 1.3.170.

 On Monday, June 3, 2013 8:58:13 AM UTC+2, Kartweel wrote: 

  The stack trace indicates version 1.3.170 ?
  
  
  

-- 
You received this message because you are subscribed to the Google Groups H2 
Database group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.




[h2] Re: NPE when shutting H2 down after integration tests run

2013-06-02 Thread Martin Lichtin
We are using 1.3.172 and have seen a very similar NPE.

2013-06-01 14:48:14,035 [Atomikos:1 ] WARN XAResourceTransaction - XA 
resource 'JDBC-H2RuleExecCamelITest': rollback for XID 
'3137322E32322E33302E37332E746D30303030313030303137:3137322E32322E33302E37332E746D31'
 
raised 0: unknown 
javax.transaction.xa.XAException: General error: 
java.lang.NullPointerException; SQL statement: 
ROLLBACK [5-170] 
at 
org.h2.jdbcx.JdbcXAConnection.convertException(JdbcXAConnection.java:397) 
at 
org.h2.jdbcx.JdbcXAConnection.rollback(JdbcXAConnection.java:282) 
at 
com.atomikos.datasource.xa.XAResourceTransaction.rollback(XAResourceTransaction.java:703)
 

at 
com.atomikos.icatch.imp.RollbackMessage.send(RollbackMessage.java:70) 
at 
com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:110) 

at 
com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:87) 
at 
com.atomikos.icatch.imp.Propagator.submitPropagationMessage(Propagator.java:66) 

at 
com.atomikos.icatch.imp.CoordinatorStateHandler.rollback(CoordinatorStateHandler.java:700)
 

at 
com.atomikos.icatch.imp.ActiveStateHandler.onTimeout(ActiveStateHandler.java:102)
 

at 
com.atomikos.icatch.imp.CoordinatorImp.alarm(CoordinatorImp.java:930) 
at 
com.atomikos.timing.PooledAlarmTimer.notifyListeners(PooledAlarmTimer.java:113) 

at 
com.atomikos.timing.PooledAlarmTimer.run(PooledAlarmTimer.java:100) 
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 

at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 

at java.lang.Thread.run(Thread.java:722) 
Caused by: org.h2.jdbc.JdbcSQLException: General error: 
java.lang.NullPointerException; SQL statement: 
ROLLBACK [5-170] 
at 
org.h2.message.DbException.getJdbcSQLException(DbException.java:329) 
at org.h2.message.DbException.get(DbException.java:158) 
at org.h2.message.DbException.convert(DbException.java:281) 
at org.h2.command.Command.executeUpdate(Command.java:234) 
at 
org.h2.jdbc.JdbcConnection.rollbackInternal(JdbcConnection.java:1423) 
at org.h2.jdbc.JdbcConnection.rollback(JdbcConnection.java:464) 
at 
org.h2.jdbcx.JdbcXAConnection.rollback(JdbcXAConnection.java:269) 
... 13 more 
Caused by: java.lang.NullPointerException 
at org.h2.table.RegularTable.removeRow(RegularTable.java:345) 
at org.h2.engine.UndoLogRecord.undo(UndoLogRecord.java:98) 
at org.h2.engine.Session.rollbackTo(Session.java:529) 
at org.h2.engine.Session.rollback(Session.java:506) 
at 
org.h2.command.dml.TransactionCommand.update(TransactionCommand.java:49) 
at org.h2.command.CommandContainer.update(CommandContainer.java:75) 
at org.h2.command.Command.executeUpdate(Command.java:230) 
... 16 more 

On Thursday, September 20, 2012 8:12:03 PM UTC+2, Thomas Mueller wrote:

 Hi,

 Does it happend with the latest version as well?

 Regards,
 Thomas


-- 
You received this message because you are subscribed to the Google Groups H2 
Database group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.