The issue I expose here seems to has already been identified, and
fixed in 1.3.162:

"When using the exclusive mode, LOB operations could cause the thread
to block. This also affected the CreateCluster tool (when using BLOB
or CLOB data)."

But I have tried in 162 and latest 164 releases, and I experience a
similar issue. I have built a very simple test case showing the issue:

1. Following the cluster creation tutorial, I create two directories:
server1 & server2

2. I run an H2 server on both:
        java org.h2.tools.Server -tcp -tcpPort 9101 -baseDir server1
        java org.h2.tools.Server -tcp -tcpPort 9102 -baseDir server2

3. I create a new database "test" on the first one, by executing the
following statements:
        create table Test(c1 number(5), c2 varchar(100), c3 CLOB);
        insert into Test(c1, c2, c3) values (10, 'Hello',
repeat('Hello', 10000));
        insert into Test(c1, c2, c3) values (20, 'World',
repeat('World', 10000));

4. I try to create a cluster, by running:
        java org.h2.tools.CreateCluster
          -urlSource jdbc:h2:tcp://localhost:9101/test
          -urlTarget jdbc:h2:tcp://localhost:9102/test
          -user sa
          -serverList localhost:9101,localhost:9102

5. The command does not terminate. An empty "backup.sql" file is
created in the current directory.

6. The JVM stack of the first server shows the following:

"H2 TCP Server (tcp://10.1.12.107:9101) thread" prio=6 tid=0x18b80400
nid=0x1064 waiting on condition [0x1947f000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at
org.h2.engine.Session.waitIfExclusiveModeEnabled(Session.java:1101)
        at org.h2.command.Command.executeQuery(Command.java:174)
        at
org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:
96)
        - locked <0x04883238> (a org.h2.engine.Session)
        at org.h2.store.LobStorage.getInputStream(LobStorage.java:564)
        - locked <0x047b8e30> (a org.h2.engine.Database)
        at org.h2.value.ValueLobDb.getInputStream(ValueLobDb.java:288)
        at org.h2.value.ValueLobDb.getReader(ValueLobDb.java:274)
        at
org.h2.command.dml.ScriptCommand.writeLobStream(ScriptCommand.java:
382)
        at org.h2.command.dml.ScriptCommand.query(ScriptCommand.java:
265)
        at org.h2.command.CommandContainer.query(CommandContainer.java:
82)
        at org.h2.command.Command.executeQuery(Command.java:187)
        - locked <0x047b8e30> (a org.h2.engine.Database)
        at org.h2.server.TcpServerThread.process(TcpServerThread.java:
303)
        at org.h2.server.TcpServerThread.run(TcpServerThread.java:146)
        at java.lang.Thread.run(Thread.java:662)

This issue seems to be very similar to the above one. It prevents me
from using clustering with my actual database (containing LOB's).
What is wrong there? Is there a workaround?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to