question: public void testSetString ( ) throws Exception { connection . setAutoCommit ( false ) ; PreparedStatement stmt = connection . prepareStatement ( "INSERT INTO test_blob(id, bin_data) VALUES(?, ?)" ) ; try { stmt . setInt ( 1 , 1 ) ; stmt . setString ( 2 , TEST_TEXT ) ; stmt . executeUpdate ( ) ; connection . commit ( ) ; stmt . setInt ( 1 , 2 ) ; stmt . setString ( 2 , TEST_TEXT ) ; stmt . executeUpdate ( ) ; connection . commit ( ) ; stmt . setInt ( 1 , 3 ) ; stmt . setString ( 2 , TEST_TEXT ) ; stmt . executeUpdate ( ) ; connection . commit ( ) ; } finally { stmt . close ( ) ; } connection . setAutoCommit ( true ) ; }
target:  This test initially was created to find the bug when LONGVARCHAR column is used, but it revealed the bug with blobs. We try to execute some blob updates one by one in non-autocommit mode.  This tests if transaction is started before the blob is created.