question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

0.41.1 causes exception when trying to read byte column from H2

See original GitHub issue

This commit turns even really short byte arrays into streams https://github.com/JetBrains/Exposed/commit/4a97034f0abfca04092e608ad99114e938e503e1

The call to reset on the input stream breaks Exposed with H2 because the InputStream implementation used by H2 doesn’t implement reset. It also seems a bit wasteful to create a stream each time.

Caused by: java.io.IOException: mark/reset not supported
	at java.base/java.io.InputStream.reset(InputStream.java:733)
	at java.base/java.io.FilterInputStream.reset(FilterInputStream.java:224)
	at org.jetbrains.exposed.sql.statements.api.ExposedBlob.getBytes(ExposedBlob.kt:8)

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
axle-hcommented, Dec 11, 2022

@kimble, @axle-h could you please share how you work with blob column as I can’t reproduce the problem?

H2 implements “small” & “large” BLOBs differently and this issue affects large BLOBS only. Maybe you have no coverage for large BLOBs?

I have a demo: https://github.com/axle-h/exposed-issue-1633-demo

1reaction
kimblecommented, Nov 18, 2022

I’m using H2 version 2.1.214. Seems like H2 is using org.h2.mvstore.StreamStore.Stream that implements InputStream, but doesn’t implement the reset method.

Screenshot from 2022-11-18 09-47-38

Seems like it is a good idea to avoid calling reset unless markSupported returns true.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · JetBrains/Exposed - GitHub
PGSQLSimpleException: 'could not serialize access due to concurrent update' ... 0.41.1 causes exception when trying to read byte column from H2.
Read more >
JetBrains - Bountysource
This exception is thrown if multiple web service calls that act on the same data structures are executed at the same time. When...
Read more >
Getting MappingException when reading TINYINT value from ...
The issue is that there is no converter from Byte (mapped to tinyint) to Boolean. I have also mapped Integer to Boolean (in...
Read more >
Advanced - H2 Database Engine
When using the cluster modes, result sets are read fully in memory by the client, so that there is no problem if the...
Read more >
Bug #4932: Error in reports after upgrade from H2 1.4.197 to ...
8 more [java] Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "CREATE TABLE REPORT_CELL (RCID BIGINT, ROW[*] INT, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found