Search in sources :

Example 1 with LobStorageMap

use of org.h2.store.LobStorageMap in project h2database by h2database.

the class TestLob method testBufferedInputStreamBug.

/**
 * Test a bug where the usage of BufferedInputStream in LobStorageMap was
 * causing a deadlock.
 */
private void testBufferedInputStreamBug() throws SQLException {
    deleteDb("lob");
    JdbcConnection conn = (JdbcConnection) getConnection("lob");
    conn.createStatement().execute("CREATE TABLE TEST(test BLOB)");
    PreparedStatement ps = conn.prepareStatement("INSERT INTO TEST(test) VALUES(?)");
    ps.setBlob(1, new ByteArrayInputStream(new byte[257]));
    ps.executeUpdate();
    conn.close();
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) JdbcConnection(org.h2.jdbc.JdbcConnection) PreparedStatement(java.sql.PreparedStatement)

Aggregations

ByteArrayInputStream (java.io.ByteArrayInputStream)1 PreparedStatement (java.sql.PreparedStatement)1 JdbcConnection (org.h2.jdbc.JdbcConnection)1