1.4.181 BLOB related issue

716 views
Skip to first unread message

Vitali Diatchkov

unread,
Sep 12, 2014, 6:51:08 PM9/12/14
to h2-da...@googlegroups.com
Hello.

The issue I describe is very critical for us. We are developing huge GIS system based on UDig platform where H2 serves as a local embedded database with spatial data type support coming with Hatbox , GeoDB, GeoTools libraries. We use BLOB data type to store geometries as WKB (well known binary), Hatbox provides spatial indexing,  etc. Everything has been working smoothly during recent year of the development with 1.3.174 and MVCC enabled.   Switch to 1.4.181 with MVStore enabled  led to BLOB columns related issues.  The most typical exception is on INSERT and it is below:

Caused by: org.h2.jdbc.JdbcSQLException: The object is already closed; SQL statement:
insert into  ............. values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [90007-181]
    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.message.DbException.get(DbException.java:144)
    at org.h2.store.LobStorageMap.createBlob(LobStorageMap.java:128)
    at org.h2.value.ValueLobDb.link(ValueLobDb.java:254)
    at org.h2.mvstore.db.MVPrimaryIndex.add(MVPrimaryIndex.java:120)
    at org.h2.mvstore.db.MVTable.addRow(MVTable.java:620)
    at org.h2.command.dml.Insert.insertRows(Insert.java:156)
    at org.h2.command.dml.Insert.update(Insert.java:114)
    at org.h2.command.CommandContainer.update(CommandContainer.java:78)
    at org.h2.command.Command.executeUpdate(Command.java:254)
    at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:198)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
    at org.jumpmind.db.sql.JdbcSqlTransaction.addRow(JdbcSqlTransaction.java:394)

1 column in the underlying table has type BLOB , some tables where this exception occur has 2 BLOB columns.  The problem occurs randomly on INSERTs to different tables having BLOB columns for geometries.  Once this exception  occurs then one of the following problems in the end is another type of exception on an attempt to SELECT..  and it is about missing chunks of data

Caused by: java.lang.IllegalStateException: Chunk 332 no longer exists [1.4.181/9]
    at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:762)
    at org.h2.mvstore.MVStore.getChunkIfFound(MVStore.java:861)
    at org.h2.mvstore.MVStore.getChunk(MVStore.java:844)
    at org.h2.mvstore.MVStore.readPage(MVStore.java:1795)
    at org.h2.mvstore.MVMap.readPage(MVMap.java:769)
    at org.h2.mvstore.Page.getChildPage(Page.java:252)
    at org.h2.mvstore.MVMap.binarySearch(MVMap.java:469)
    at org.h2.mvstore.MVMap.binarySearch(MVMap.java:470)
    at org.h2.mvstore.MVMap.get(MVMap.java:451)
    at org.h2.mvstore.MVMapConcurrent.remove(MVMapConcurrent.java:71)
    at org.h2.store.LobStorageMap.removeLob(LobStorageMap.java:292)
    at org.h2.store.LobStorageMap.removeLob(LobStorageMap.java:278)
    at org.h2.value.ValueLobDb.close(ValueLobDb.java:227)
    at org.h2.engine.Session.endTransaction(Session.java:552)
    at org.h2.engine.Session.commit(Session.java:536)
    at org.h2.command.Command.stop(Command.java:152)
    at org.h2.command.Command.executeUpdate(Command.java:284)
    at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:184)
    at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:158)


Transactions are manually managed (no autocommit) in the application. Usually there is  a 1 transaction opened, being committed or rolled back from time to time, other connections are used for simultaneous reading.
We temporarily switched back to previous version that was stable but looking forward to MVStore.


I am planning to do some debugging my myself and may be provide more info later. For now it seams something is broken/not stable/not complete  in MVStore for BLOBs..   Any comments from H2 team? You may get whatever help you need from us to debug and provide more info to you..  Anyway H2 is a great piece of software, thanks , guys :)

Vitali.

cyrilantony

unread,
Oct 14, 2014, 9:38:33 PM10/14/14
to h2-da...@googlegroups.com
Hello,

Encountered similar exception as mentioned above .
But it was resolved by setting System property 'h2.serverCachedObjects'
(default: 64) to a higher value like 2000.
See https://groups.google.com/d/msg/h2-database/jQJsENSc1LY/_3rIC6aaacEJ

Now got another issue with blob column in table .
See error log below. Any help is appreciated.

Caused by: java.io.IOException: org.h2.message.DbException: General error:
"java.lang.RuntimeException: Lob not found: 12603" [50000-181]
at org.h2.message.DbException.convertToIOException(DbException.java:364)
at
org.h2.store.LobStorageRemoteInputStream.read(LobStorageRemoteInputStream.java:73)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at
java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2265)
at
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2278)
at
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2749)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:779)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:279)
at
org.apache.ode.scheduler.simple.JdbcDelegate.dequeueImmediate(JdbcDelegate.java:214)
... 12 more
Caused by: org.h2.message.DbException: General error:
"java.lang.RuntimeException: Lob not found: 12603" [50000-181]
at org.h2.message.DbException.convert(DbException.java:283)
at org.h2.engine.SessionRemote.done(SessionRemote.java:629)
at org.h2.engine.SessionRemote.readLob(SessionRemote.java:778)
at
org.h2.store.LobStorageRemoteInputStream.read(LobStorageRemoteInputStream.java:71)
... 21 more
Caused by: org.h2.jdbc.JdbcSQLException: General error:
"java.lang.RuntimeException: Lob not found: 12603" [50000-181]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:295)
at org.h2.server.TcpServerThread.sendError(TcpServerThread.java:221)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:161)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: Lob not found: 12603
at org.h2.message.DbException.throwInternalError(DbException.java:242)
at org.h2.store.LobStorageMap.getInputStream(LobStorageMap.java:236)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:454)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:159)
... 1 more


Thanks,
Cyril



--
View this message in context: http://h2-database.66688.n3.nabble.com/1-4-181-BLOB-related-issue-tp4029954p4030124.html
Sent from the H2 Database mailing list archive at Nabble.com.

Thomas Mueller

unread,
Oct 15, 2014, 2:13:06 AM10/15/14
to h2-da...@googlegroups.com
Hi,

If you have a reproducible test case, could you please post it?

Please note version 1.4.x is still beta. If you need a stable version, you can download version 1.3.x, or you can append ";mv_store=false" to the database URL.

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...@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

ma...@bwaldvogel.de

unread,
Nov 5, 2014, 11:29:55 AM11/5/14
to h2-da...@googlegroups.com
Hi,

I encountered this issue (java.lang.RuntimeException: Lob not found) with 1.4.182. Using 1.3.x with "MVCC=true" or 1.4 with ";mv_store=false;MVCC=true" mitigates this issue for me.
Anyway, I would like to contribute to find the issue in the MV Store since I can reliably reproduce the issue in my unit test when I start several instances concurrently.
Unfortunately, I wasn't able to reduce my test case nor can I publish the test.

Thomas, do you have an idea how I could help anyway?

Best,
Benedikt

ma...@bwaldvogel.de

unread,
Nov 18, 2014, 5:15:16 PM11/18/14
to h2-da...@googlegroups.com
Hi,

I've finally managed to reduce the test case to something minimal that reproducibly fails.
The little project is on GitHub: https://github.com/bwaldvogel/h2-lob-issue

Just run ./gradlew --info in your shell or run the H2LobIssueTest in your IDE.
At least it fails on my machine and on Travis: https://travis-ci.org/bwaldvogel/h2-lob-issue/builds/41416079

HTH,
Benedikt

ma...@bwaldvogel.de

unread,
Nov 18, 2014, 5:17:13 PM11/18/14
to h2-da...@googlegroups.com
On Tuesday, November 18, 2014 11:15:16 PM UTC+1, ma...@bwaldvogel.de wrote:
Just run ./gradlew --info in your shell or run the H2LobIssueTest in your IDE.
 
Of course I meant ./gradlew --info build

Noel Grandin

unread,
Nov 19, 2014, 4:14:42 AM11/19/14
to h2-da...@googlegroups.com
Could you modify the test to be jdk1.6 compliant and free of Spring and javax.persistence stuff?

Sorry, but I limited time to debug issues so I'm not keen on fighting with adding libraries and changing my compiler. If
I can't just drop the test-case into my H2 project and run it, it's not something I can help with.

Thomas Mueller

unread,
Nov 19, 2014, 4:25:22 AM11/19/14
to H2 Google Group
Hi,

I'm very interested in this issue.

To avoid having to change the test case, could you add ";trace_level_system_out=3" to the database URL, and then send me / post the resulting output? This should include all the JDBC API calls. That way it should be quite easy to write a pure JDBC test case. Or append ";trace_level_file=3" and then send the <databaseName>.trace.db file.

Regards,
Thomas


On Wed, Nov 19, 2014 at 10:14 AM, Noel Grandin <noelg...@gmail.com> wrote:
Could you modify the test to be jdk1.6 compliant and free of Spring and javax.persistence stuff?

Sorry, but I limited time to debug issues so I'm not keen on fighting with adding libraries and changing my compiler. If I can't just drop the test-case into my H2 project and run it, it's not something I can help with.
--
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+unsubscribe@googlegroups.com.

Benedikt Waldvogel

unread,
Nov 20, 2014, 3:30:31 AM11/20/14
to h2-da...@googlegroups.com
Hi,

On Wed, November 19, 2014 10:25, Thomas Mueller wrote:
> To avoid having to change the test case, could you add
> ";trace_level_system_out=3" to the database URL, and then send me / post
> the resulting output? This should include all the JDBC API calls. That way
> it should be quite easy to write a pure JDBC test case. Or append
> ";trace_level_file=3" and then send the <databaseName>.trace.db file.

please find a trace on https://paste.ee/p/Ri7xi

Let me know when you need more info.


Best,
Benedikt

christof...@finaris.de

unread,
Nov 20, 2014, 5:00:37 AM11/20/14
to h2-da...@googlegroups.com
Hi,

I use H2 1.3.176 (last stable).
The following exception was thrown while executing multiple database operations in parallel, maybe it could helpful for you to apply a fix.
Unfortunately, I cannot provide a testcase for this.


java.sql.SQLException: Folgende SQL-Anweisung konnte nicht ausgeführt werden:
create trigger if not exists REPORT_567.ACTUALRESULTS_23_ADTRIGGER AFTER DELETE on REPORT_567.ACTUALRESULTS_23 call "com.rapidrep.kernel.internaldb.h2.triggers.AfterDeleteTrigger"
  at com.rapidrep.kernel.internaldb.common.InternalDatabaseLayer.executeSQLInInternalDB(InternalDatabaseLayer.java:1101)
  at com.rapidrep.kernel.internaldb.common.InternalDatabaseLayer.executeSQLInInternalDB(InternalDatabaseLayer.java:1069)
  at com.rapidrep.kernel.internaldb.common.InternalDatabaseLayer.createTriggers(InternalDatabaseLayer.java:1207)
  at com.rapidrep.kernel.internaldb.common.InternalDatabaseLayer.createTableFunctionForScript(InternalDatabaseLayer.java:1193)
[...]
Caused by: org.h2.jdbc.JdbcSQLException: Fehler beim Erzeugen des Triggers "ACTUALRESULTS_23_ADTRIGGER", Klasse "com.rapidrep.kernel.internaldb.h2.triggers.AfterDeleteTrigger", Grund: "com.rapidrep.kernel.internaldb.h2.triggers.AfterDeleteTrigger"; siehe Ursache für Details
Error creating or initializing trigger "ACTUALRESULTS_23_ADTRIGGER" object, class "com.rapidrep.kernel.internaldb.h2.triggers.AfterDeleteTrigger", cause: "org.h2.jdbc.JdbcSQLException: Allgemeiner Fehler: ""java.util.ConcurrentModificationException""
General error: ""java.util.ConcurrentModificationException""; SQL statement:
SELECT TABLE_CATALOG TABLE_CAT, TABLE_SCHEMA TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, DATA_TYPE, TYPE_NAME, CHARACTER_MAXIMUM_LENGTH COLUMN_SIZE, CHARACTER_MAXIMUM_LENGTH BUFFER_LENGTH, NUMERIC_SCALE DECIMAL_DIGITS, NUMERIC_PRECISION_RADIX NUM_PREC_RADIX, NULLABLE, REMARKS, COLUMN_DEFAULT COLUMN_DEF, DATA_TYPE SQL_DATA_TYPE, ZERO() SQL_DATETIME_SUB, CHARACTER_OCTET_LENGTH CHAR_OCTET_LENGTH, ORDINAL_POSITION, IS_NULLABLE IS_NULLABLE, CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CATALOG, CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_SCHEMA, CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_TABLE, SOURCE_DATA_TYPE, CASE WHEN SEQUENCE_NAME IS NULL THEN CAST(? AS VARCHAR) ELSE CAST(? AS VARCHAR) END IS_AUTOINCREMENT, CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CATLOG FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_CATALOG LIKE ? ESCAPE ? AND TABLE_SCHEMA LIKE ? ESCAPE ? AND TABLE_NAME LIKE ? ESCAPE ? AND COLUMN_NAME LIKE ? ESCAPE ? ORDER BY TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION [50000-176]"; see root cause for details; SQL statement:
create trigger if not exists REPORT_567.ACTUALRESULTS_23_ADTRIGGER AFTER DELETE on REPORT_567.ACTUALRESULTS_23 call "com.rapidrep.kernel.internaldb.h2.triggers.AfterDeleteTrigger" [90043-176]
  at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
  at org.h2.message.DbException.get(DbException.java:167)
  at org.h2.schema.TriggerObject.load(TriggerObject.java:77)
  at org.h2.schema.TriggerObject.setTriggerClassName(TriggerObject.java:92)
  at org.h2.command.ddl.CreateTrigger.update(CreateTrigger.java:110)
  at org.h2.command.CommandContainer.update(CommandContainer.java:79)
  at org.h2.command.Command.executeUpdate(Command.java:254)
  at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:186)
  at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:160)
  at com.rapidrep.kernel.internaldb.common.InternalDatabaseLayer.executeSQLInInternalDB(InternalDatabaseLayer.java:1093)
  ... 11 more
Caused by: org.h2.jdbc.JdbcSQLException: Allgemeiner Fehler: "java.util.ConcurrentModificationException"
General error: "java.util.ConcurrentModificationException"; SQL statement:
SELECT TABLE_CATALOG TABLE_CAT, TABLE_SCHEMA TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, DATA_TYPE, TYPE_NAME, CHARACTER_MAXIMUM_LENGTH COLUMN_SIZE, CHARACTER_MAXIMUM_LENGTH BUFFER_LENGTH, NUMERIC_SCALE DECIMAL_DIGITS, NUMERIC_PRECISION_RADIX NUM_PREC_RADIX, NULLABLE, REMARKS, COLUMN_DEFAULT COLUMN_DEF, DATA_TYPE SQL_DATA_TYPE, ZERO() SQL_DATETIME_SUB, CHARACTER_OCTET_LENGTH CHAR_OCTET_LENGTH, ORDINAL_POSITION, IS_NULLABLE IS_NULLABLE, CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CATALOG, CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_SCHEMA, CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_TABLE, SOURCE_DATA_TYPE, CASE WHEN SEQUENCE_NAME IS NULL THEN CAST(? AS VARCHAR) ELSE CAST(? AS VARCHAR) END IS_AUTOINCREMENT, CAST(SOURCE_DATA_TYPE AS VARCHAR) SCOPE_CATLOG FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_CATALOG LIKE ? ESCAPE ? AND TABLE_SCHEMA LIKE ? ESCAPE ? AND TABLE_NAME LIKE ? ESCAPE ? AND COLUMN_NAME LIKE ? ESCAPE ? ORDER BY TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION [50000-176]
  at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
  at org.h2.message.DbException.get(DbException.java:167)
  at org.h2.message.DbException.convert(DbException.java:294)
  at org.h2.command.Command.executeQuery(Command.java:209)
  at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:109)
  at org.h2.jdbc.JdbcDatabaseMetaData.getColumns(JdbcDatabaseMetaData.java:285)
  at org.h2.tools.TriggerAdapter.init(TriggerAdapter.java:70)
  at org.h2.schema.TriggerObject.load(TriggerObject.java:72)
  ... 18 more
Caused by: java.util.ConcurrentModificationException
  at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
  at java.util.HashMap$ValueIterator.next(Unknown Source)
  at org.h2.engine.Database.getAllTablesAndViews(Database.java:1466)
  at org.h2.table.MetaTable.getAllTables(MetaTable.java:610)
  at org.h2.table.MetaTable.generateRows(MetaTable.java:721)
  at org.h2.index.MetaIndex.find(MetaIndex.java:51)
  at org.h2.index.BaseIndex.find(BaseIndex.java:128)
  at org.h2.index.IndexCursor.find(IndexCursor.java:160)
  at org.h2.table.TableFilter.next(TableFilter.java:330)
  at org.h2.command.dml.Select.queryFlat(Select.java:533)
  at org.h2.command.dml.Select.queryWithoutCache(Select.java:646)
  at org.h2.command.dml.Query.query(Query.java:323)
  at org.h2.command.dml.Query.query(Query.java:291)
  at org.h2.command.dml.Query.query(Query.java:37)
  at org.h2.command.CommandContainer.query(CommandContainer.java:91)
  at org.h2.command.Command.executeQuery(Command.java:197)
  ... 22 more




Kind regards,

Christoff Schmitz

F I N A R I S
Financial Software Partner GmbH
Sömmerringstrasse 23
60322 Frankfurt am Main

Fon:      +49 (0)69  / 254 98 - 24
Mobile: +49 (0)176 / 206 34 186
Fax:       +49 (0)69  / 254 98 - 50
eMail:    
mailto:Christof...@finaris.de
www:      
http://www.finaris.de und http://www.rapidrep.com
--
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...@googlegroups.com.

To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at
http://groups.google.com/group/h2-database.
For more options, visit
https://groups.google.com/d/optout.



================================================================================================================
Disclaimer
The information contained in this e - mail and any attachments ( together the "message") is intended for the addressee only and
may contain confidential and/or privileged information. If you have received the message by mistake please delete it and notify
the sender and do not copy or distribute it or disclose its contents to anyone.

FINARIS Financial Software Partner GmbH, Sömmerringstr. 23, 60322 Frankfurt/Main, Germany
Registered at Frankfurt/Main, HRB 52873, Managing Directors: Dipl. Inf. Hermann Friebel, Dipl. Ing. Kai Bächle, Dipl. Inf. Werner Märkl
================================================================================================================

Noel Grandin

unread,
Nov 20, 2014, 5:02:12 AM11/20/14
to h2-da...@googlegroups.com
What does your database URL look like?

christof...@finaris.de

unread,
Nov 20, 2014, 5:13:13 AM11/20/14
to h2-da...@googlegroups.com
jdbc:h2:file:<PATH>;MULTI_THREADED=1;DB_CLOSE_DELAY=-1;LOG=0;UNDO_LOG=0;QUERY_CACHE_SIZE=0;CACHE_SIZE=16384

The database is only required during runtime of my application.
Therefore undo and transaction log are disabled to improve performance.

Kind regards,

Christoff Schmitz

F I N A R I S
Financial Software Partner GmbH
Sömmerringstrasse 23
60322 Frankfurt am Main

Fon:      +49 (0)69  / 254 98 - 24
Mobile: +49 (0)176 / 206 34 186
Fax:       +49 (0)69  / 254 98 - 50
eMail:    
mailto:Christof...@finaris.de
www:      
http://www.finaris.de und http://www.rapidrep.com



--
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...@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at
http://groups.google.com/group/h2-database.
For more options, visit
https://groups.google.com/d/optout.

Noel Grandin

unread,
Nov 20, 2014, 5:25:21 AM11/20/14
to h2-da...@googlegroups.com
Yeah, sorry, I'm not really interested in debugging anything with the logs turned off.
Those are "use at your own risk" features.

And MULTI_THREADED is still experimental in 1.3.176 (and still buggy in 1.4)

If you reproduce with 1.4 and the logs turned on, then I'd be willing to try and track it down.

Thomas Mueller

unread,
Nov 20, 2014, 12:47:58 PM11/20/14
to h2-da...@googlegroups.com
Hi,

I can now reproduce the problem, using the following test case. Thanks a lot!


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...@googlegroups.com.

Thomas Mueller

unread,
Nov 21, 2014, 8:27:08 AM11/21/14
to h2-da...@googlegroups.com
Hi,

Further simplified (in case you are interested):

    public static void main(String... args) throws Exception {
        final String url = "jdbc:h2:mem:test";
        Connection conn = DriverManager.getConnection(url);
        Statement stat = conn.createStatement();
        stat.execute("create table lob(id identity, lob blob)");
        stat.execute("insert into lob(id, lob) values(null, '')");
        Thread[] threads = new Thread[3];
        final AtomicBoolean stop = new AtomicBoolean();
        for (int i = 0; i < threads.length; i++) {
            Thread t = new Thread() {
                @Override
                public void run() {
                    try {
                        Connection conn = DriverManager.getConnection(url);
                        PreparedStatement prep = conn.prepareStatement(
                                    "update lob set lob=? where id=1");
                        Statement stat = conn.createStatement();
                        while (!stop.get()) {
                            prep.setBinaryStream(1, 
                                    new ByteArrayInputStream(new byte[10]));
                            prep.executeUpdate();
                            ResultSet rs = stat.executeQuery(
                                    "select lob from lob where id=1");
                            rs.next();
                            rs.getBlob(1).getBinaryStream().read();
                        }
                        conn.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            };
            t.start();
            threads[i] = t;
        }
        Thread.sleep(100000);
        stop.set(true);
        for (Thread t : threads) {
            t.join();
        }
        conn.close();
    }
    
    
Regards,
Thomas

Thomas Mueller

unread,
Dec 15, 2014, 1:46:51 AM12/15/14
to h2-da...@googlegroups.com
Hi,

I forgot to say: this is fixed now (I think even with 1.4.182).

Regards,
Thomas

Benedikt Waldvogel

unread,
Dec 15, 2014, 2:00:24 PM12/15/14
to h2-da...@googlegroups.com
Hi Thomas,

On 15.12.2014 07:46, Thomas Mueller wrote:
> I forgot to say: this is fixed now (I think even with 1.4.182).

Thanks!

I can confirm that it is fixed with 1.4.183.
It was still failing in 1.4.182: https://github.com/bwaldvogel/h2-lob-issue

Best,
Benedikt
Reply all
Reply to author
Forward
0 new messages