HHH-5550 - Hibernate.createBlob() fails when used in current_session_context_class=thread mode

This commit is contained in:
Steve Ebersole 2011-01-21 14:16:23 -06:00
parent b3967db041
commit b1bbdebd27
1 changed files with 4 additions and 10 deletions

View File

@ -29,8 +29,6 @@ import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.testing.junit.functional.FunctionalTestCase; import org.hibernate.testing.junit.functional.FunctionalTestCase;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.SQLException; import java.sql.SQLException;
/** /**
@ -56,14 +54,10 @@ public class HibernateCreateBlobFailedCase extends FunctionalTestCase {
public void testLobCreation() throws SQLException { public void testLobCreation() throws SQLException {
Session session = sfi().getCurrentSession(); Session session = sfi().getCurrentSession();
session.beginTransaction(); session.beginTransaction();
Blob blob = Hibernate.getLobCreator( session ).createBlob( new byte[] {} ); Hibernate.getLobCreator( session ).createBlob( new byte[] {} );
blob.free(); Hibernate.createBlob( new byte[] {}, session );
blob = Hibernate.createBlob( new byte[] {}, session ); Hibernate.getLobCreator( session ).createClob( "Steve" );
blob.free(); Hibernate.createClob( "Steve", session );
Clob clob = Hibernate.getLobCreator( session ).createClob( "Steve" );
clob.free();
clob = Hibernate.createClob( "Steve", session );
clob.free();
session.getTransaction().commit(); session.getTransaction().commit();
assertFalse( session.isOpen() ); assertFalse( session.isOpen() );
} }