Hibernate SVN: r15227 - core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-09-29 17:41:30 -0400 (Mon, 29 Sep 2008)
New Revision: 15227
Modified:
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java
Log:
HHH-3501 : ASTParserLoadingTest testing unsupported queries for DB2
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java 2008-09-29 21:39:00 UTC (rev 15226)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java 2008-09-29 21:41:30 UTC (rev 15227)
@@ -126,7 +126,13 @@
assertEquals( 1, results.size() );
results = s.createQuery( "from Human where name is not null" ).list();
assertEquals( 3, results.size() );
- s.createQuery( "from Human where ? is null" ).setParameter( 0, null ).list();
+ String query =
+ getDialect() instanceof DB2Dialect ?
+ "from Human where cast(? as string) is null" :
+ "from Human where ? is null"
+ ;
+ s.createQuery( query ).setParameter( 0, null ).list();
+
s.getTransaction().commit();
s.close();
@@ -203,13 +209,29 @@
s.beginTransaction();
s.createQuery( "from Animal a where abs(a.bodyWeight-:param) < 2.0" ).setLong( "param", 1 ).list();
s.createQuery( "from Animal a where abs(:param - a.bodyWeight) < 2.0" ).setLong( "param", 1 ).list();
- if ( ! ( getDialect() instanceof HSQLDialect ) ) {
- // HSQLDB does not like the abs(? - ?) syntax...
+ if ( ( getDialect() instanceof HSQLDialect ) || ( getDialect() instanceof DB2Dialect ) ) {
+ // HSQLDB and DB2 don't like the abs(? - ?) syntax. bit work if at least one parameter is typed...
+ s.createQuery( "from Animal where abs(cast(:x as long) - :y) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
+ s.createQuery( "from Animal where abs(:x - cast(:y as long)) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
+ s.createQuery( "from Animal where abs(cast(:x as long) - cast(:y as long)) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
+ }
+ else {
s.createQuery( "from Animal where abs(:x - :y) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
}
- s.createQuery( "from Animal where lower(upper(:foo)) like 'f%'" ).setString( "foo", "foo" ).list();
+
+ if ( getDialect() instanceof DB2Dialect ) {
+ s.createQuery( "from Animal where lower(upper(cast(:foo as string))) like 'f%'" ).setString( "foo", "foo" ).list();
+ }
+ else {
+ s.createQuery( "from Animal where lower(upper(:foo)) like 'f%'" ).setString( "foo", "foo" ).list();
+ }
s.createQuery( "from Animal a where abs(abs(a.bodyWeight - 1.0 + :param) * abs(length('ffobar')-3)) = 3.0" ).setLong( "param", 1 ).list();
- s.createQuery( "from Animal where lower(upper('foo') || upper(:bar)) like 'f%'" ).setString( "bar", "xyz" ).list();
+ if ( getDialect() instanceof DB2Dialect ) {
+ s.createQuery( "from Animal where lower(upper('foo') || upper(cast(:bar as string))) like 'f%'" ).setString( "bar", "xyz" ).list();
+ }
+ else {
+ s.createQuery( "from Animal where lower(upper('foo') || upper(:bar)) like 'f%'" ).setString( "bar", "xyz" ).list();
+ }
if ( ! ( getDialect() instanceof PostgreSQLDialect || getDialect() instanceof MySQLDialect ) ) {
s.createQuery( "from Animal where abs(cast(1 as float) - cast(:param as float)) = 1.0" ).setLong( "param", 1 ).list();
}
16 years, 3 months
Hibernate SVN: r15226 - core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-09-29 17:39:00 -0400 (Mon, 29 Sep 2008)
New Revision: 15226
Modified:
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ASTParserLoadingTest.java
Log:
JBPAPP-948 HHH-3501 : ASTParserLoadingTest testing unsupported queries for DB2
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ASTParserLoadingTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2008-09-29 21:36:27 UTC (rev 15225)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2008-09-29 21:39:00 UTC (rev 15226)
@@ -167,13 +167,29 @@
s.beginTransaction();
s.createQuery( "from Animal a where abs(a.bodyWeight-:param) < 2.0" ).setLong( "param", 1 ).list();
s.createQuery( "from Animal a where abs(:param - a.bodyWeight) < 2.0" ).setLong( "param", 1 ).list();
- if ( ! ( getDialect() instanceof HSQLDialect ) ) {
- // HSQLDB does not like the abs(? - ?) syntax...
+ if ( ( getDialect() instanceof HSQLDialect ) || ( getDialect() instanceof DB2Dialect ) ) {
+ // HSQLDB and DB2 don't like the abs(? - ?) syntax. bit work if at least one parameter is typed...
+ s.createQuery( "from Animal where abs(cast(:x as long) - :y) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
+ s.createQuery( "from Animal where abs(:x - cast(:y as long)) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
+ s.createQuery( "from Animal where abs(cast(:x as long) - cast(:y as long)) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
+ }
+ else {
s.createQuery( "from Animal where abs(:x - :y) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
}
- s.createQuery( "from Animal where lower(upper(:foo)) like 'f%'" ).setString( "foo", "foo" ).list();
+
+ if ( getDialect() instanceof DB2Dialect ) {
+ s.createQuery( "from Animal where lower(upper(cast(:foo as string))) like 'f%'" ).setString( "foo", "foo" ).list();
+ }
+ else {
+ s.createQuery( "from Animal where lower(upper(:foo)) like 'f%'" ).setString( "foo", "foo" ).list();
+ }
s.createQuery( "from Animal a where abs(abs(a.bodyWeight - 1.0 + :param) * abs(length('ffobar')-3)) = 3.0" ).setLong( "param", 1 ).list();
- s.createQuery( "from Animal where lower(upper('foo') || upper(:bar)) like 'f%'" ).setString( "bar", "xyz" ).list();
+ if ( getDialect() instanceof DB2Dialect ) {
+ s.createQuery( "from Animal where lower(upper('foo') || upper(cast(:bar as string))) like 'f%'" ).setString( "bar", "xyz" ).list();
+ }
+ else {
+ s.createQuery( "from Animal where lower(upper('foo') || upper(:bar)) like 'f%'" ).setString( "bar", "xyz" ).list();
+ }
if ( ! ( getDialect() instanceof PostgreSQLDialect || getDialect() instanceof MySQLDialect ) ) {
s.createQuery( "from Animal where abs(cast(1 as float) - cast(:param as float)) = 1.0" ).setLong( "param", 1 ).list();
}
16 years, 3 months
Hibernate SVN: r15225 - core/branches/Branch_3_2/test/org/hibernate/test/hql.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-09-29 17:36:27 -0400 (Mon, 29 Sep 2008)
New Revision: 15225
Modified:
core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java
Log:
HHH-3501 : ASTParserLoadingTest testing unsupported queries for DB2
Modified: core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2008-09-29 15:35:13 UTC (rev 15224)
+++ core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2008-09-29 21:36:27 UTC (rev 15225)
@@ -125,7 +125,12 @@
assertEquals( 1, results.size() );
results = s.createQuery( "from Human where name is not null" ).list();
assertEquals( 3, results.size() );
- s.createQuery( "from Human where ? is null" ).setParameter( 0, null ).list();
+ String query =
+ getDialect() instanceof DB2Dialect ?
+ "from Human where cast(? as string) is null" :
+ "from Human where ? is null"
+ ;
+ s.createQuery( query ).setParameter( 0, null ).list();
s.getTransaction().commit();
s.close();
@@ -202,13 +207,29 @@
s.beginTransaction();
s.createQuery( "from Animal a where abs(a.bodyWeight-:param) < 2.0" ).setLong( "param", 1 ).list();
s.createQuery( "from Animal a where abs(:param - a.bodyWeight) < 2.0" ).setLong( "param", 1 ).list();
- if ( ! ( getDialect() instanceof HSQLDialect ) ) {
- // HSQLDB does not like the abs(? - ?) syntax...
+ if ( ( getDialect() instanceof HSQLDialect ) || ( getDialect() instanceof DB2Dialect ) ) {
+ // HSQLDB and DB2 don't like the abs(? - ?) syntax. bit work if at least one parameter is typed...
+ s.createQuery( "from Animal where abs(cast(:x as long) - :y) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
+ s.createQuery( "from Animal where abs(:x - cast(:y as long)) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
+ s.createQuery( "from Animal where abs(cast(:x as long) - cast(:y as long)) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
+ }
+ else {
s.createQuery( "from Animal where abs(:x - :y) < 2.0" ).setLong( "x", 1 ).setLong( "y", 1 ).list();
}
- s.createQuery( "from Animal where lower(upper(:foo)) like 'f%'" ).setString( "foo", "foo" ).list();
+
+ if ( getDialect() instanceof DB2Dialect ) {
+ s.createQuery( "from Animal where lower(upper(cast(:foo as string))) like 'f%'" ).setString( "foo", "foo" ).list();
+ }
+ else {
+ s.createQuery( "from Animal where lower(upper(:foo)) like 'f%'" ).setString( "foo", "foo" ).list();
+ }
s.createQuery( "from Animal a where abs(abs(a.bodyWeight - 1.0 + :param) * abs(length('ffobar')-3)) = 3.0" ).setLong( "param", 1 ).list();
- s.createQuery( "from Animal where lower(upper('foo') || upper(:bar)) like 'f%'" ).setString( "bar", "xyz" ).list();
+ if ( getDialect() instanceof DB2Dialect ) {
+ s.createQuery( "from Animal where lower(upper('foo') || upper(cast(:bar as string))) like 'f%'" ).setString( "bar", "xyz" ).list();
+ }
+ else {
+ s.createQuery( "from Animal where lower(upper('foo') || upper(:bar)) like 'f%'" ).setString( "bar", "xyz" ).list();
+ }
if ( ! ( getDialect() instanceof PostgreSQLDialect || getDialect() instanceof MySQLDialect ) ) {
s.createQuery( "from Animal where abs(cast(1 as float) - cast(:param as float)) = 1.0" ).setLong( "param", 1 ).list();
}
16 years, 3 months
Hibernate SVN: r15224 - in search/trunk/src/java/org/hibernate/search: engine and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: sannegrinovero
Date: 2008-09-29 11:35:13 -0400 (Mon, 29 Sep 2008)
New Revision: 15224
Added:
search/trunk/src/java/org/hibernate/search/backend/WorkVisitor.java
Modified:
search/trunk/src/java/org/hibernate/search/backend/AddLuceneWork.java
search/trunk/src/java/org/hibernate/search/backend/DeleteLuceneWork.java
search/trunk/src/java/org/hibernate/search/backend/LuceneWork.java
search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java
search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java
search/trunk/src/java/org/hibernate/search/engine/DocumentBuilder.java
search/trunk/src/java/org/hibernate/search/engine/SearchFactoryImplementor.java
search/trunk/src/java/org/hibernate/search/impl/SearchFactoryImpl.java
Log:
backend refactoring, step1: make all LuceneWork threadsafe(was needed anyway) and "visitable".
Modified: search/trunk/src/java/org/hibernate/search/backend/AddLuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/AddLuceneWork.java 2008-09-26 18:56:55 UTC (rev 15223)
+++ search/trunk/src/java/org/hibernate/search/backend/AddLuceneWork.java 2008-09-29 15:35:13 UTC (rev 15224)
@@ -13,6 +13,16 @@
private static final long serialVersionUID = -2450349312813297371L;
public AddLuceneWork(Serializable id, String idInString, Class entity, Document document) {
- super( id, idInString, entity, document );
+ super( id, idInString, entity, document, false );
}
+
+ public AddLuceneWork(Serializable id, String idInString, Class entity, Document document, boolean batch) {
+ super( id, idInString, entity, document, batch );
+ }
+
+ @Override
+ public <T> T getWorkDelegate(final WorkVisitor<T> visitor) {
+ return visitor.getDelegate( this );
+ }
+
}
Modified: search/trunk/src/java/org/hibernate/search/backend/DeleteLuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/DeleteLuceneWork.java 2008-09-26 18:56:55 UTC (rev 15223)
+++ search/trunk/src/java/org/hibernate/search/backend/DeleteLuceneWork.java 2008-09-29 15:35:13 UTC (rev 15224)
@@ -7,9 +7,16 @@
* @author Emmanuel Bernard
*/
public class DeleteLuceneWork extends LuceneWork implements Serializable {
+
private static final long serialVersionUID = -854604138119230246L;
public DeleteLuceneWork(Serializable id, String idInString, Class entity) {
super( id, idInString, entity );
}
+
+ @Override
+ public <T> T getWorkDelegate(final WorkVisitor<T> visitor) {
+ return visitor.getDelegate( this );
+ }
+
}
Modified: search/trunk/src/java/org/hibernate/search/backend/LuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/LuceneWork.java 2008-09-26 18:56:55 UTC (rev 15223)
+++ search/trunk/src/java/org/hibernate/search/backend/LuceneWork.java 2008-09-29 15:35:13 UTC (rev 15224)
@@ -17,6 +17,7 @@
*
* @author Emmanuel Bernard
* @author Hardy Ferentschik
+ * @author Sanne Grinovero
*/
public abstract class LuceneWork implements Serializable {
@@ -27,7 +28,7 @@
/**
* Flag indicating if this lucene work has to be indexed in batch mode.
*/
- private boolean batch = false;
+ private final boolean batch;
private final String idInString;
public LuceneWork(Serializable id, String idInString, Class entity) {
@@ -35,21 +36,21 @@
}
public LuceneWork(Serializable id, String idInString, Class entity, Document document) {
+ this( id, idInString, entity, document, false );
+ }
+
+ public LuceneWork(Serializable id, String idInString, Class entity, Document document, boolean batch) {
this.id = id;
this.idInString = idInString;
this.entityClass = entity;
this.document = document;
+ this.batch = batch;
}
public boolean isBatch() {
return batch;
}
- //TODO move to final field, or enable synchronization?
- public void setBatch(boolean batch) {
- this.batch = batch;
- }
-
public Document getDocument() {
return document;
}
@@ -65,4 +66,7 @@
public String getIdInString() {
return idInString;
}
+
+ public abstract <T> T getWorkDelegate(WorkVisitor<T> visitor);
+
}
Modified: search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java 2008-09-26 18:56:55 UTC (rev 15223)
+++ search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java 2008-09-29 15:35:13 UTC (rev 15224)
@@ -4,15 +4,22 @@
import java.io.Serializable;
/**
- * A unit of work triggering an optimize operation
+ * A unit of work triggering an optimize operation.
* This work does not propagate to a cluster: it should be filtered before being sent to
- * the network
+ * the network.
*
* @author Andrew Hahn
* @author Emmanuel Bernard
*/
public class OptimizeLuceneWork extends LuceneWork implements Serializable {
+
public OptimizeLuceneWork(Class entity) {
super( null, null, entity );
}
+
+ @Override
+ public <T> T getWorkDelegate(final WorkVisitor<T> visitor) {
+ return visitor.getDelegate( this );
+ }
+
}
Modified: search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java 2008-09-26 18:56:55 UTC (rev 15223)
+++ search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java 2008-09-29 15:35:13 UTC (rev 15224)
@@ -9,9 +9,16 @@
* @author John Griffin
*/
public class PurgeAllLuceneWork extends LuceneWork implements Serializable {
+
private static final long serialVersionUID = 8124091288284011715L;
public PurgeAllLuceneWork(Class entity) {
super( null, null, entity, null );
}
+
+ @Override
+ public <T> T getWorkDelegate(final WorkVisitor<T> visitor) {
+ return visitor.getDelegate( this );
+ }
+
}
Added: search/trunk/src/java/org/hibernate/search/backend/WorkVisitor.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/WorkVisitor.java (rev 0)
+++ search/trunk/src/java/org/hibernate/search/backend/WorkVisitor.java 2008-09-29 15:35:13 UTC (rev 15224)
@@ -0,0 +1,22 @@
+package org.hibernate.search.backend;
+
+/**
+ * A visitor delegate to manipulate a LuceneWork
+ * needs to implement this interface.
+ * This pattern enables any implementation to virtually add delegate
+ * methods to the base LuceneWork without having to change them.
+ * This contract however breaks if more subclasses of LuceneWork
+ * are created, as a visitor must support all existing types.
+ *
+ * @author Sanne Grinovero
+ *
+ * @param <T> used to force a return type of choice.
+ */
+public interface WorkVisitor<T> {
+
+ T getDelegate(AddLuceneWork addLuceneWork);
+ T getDelegate(DeleteLuceneWork deleteLuceneWork);
+ T getDelegate(OptimizeLuceneWork optimizeLuceneWork);
+ T getDelegate(PurgeAllLuceneWork purgeAllLuceneWork);
+
+}
Modified: search/trunk/src/java/org/hibernate/search/engine/DocumentBuilder.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/engine/DocumentBuilder.java 2008-09-26 18:56:55 UTC (rev 15223)
+++ search/trunk/src/java/org/hibernate/search/engine/DocumentBuilder.java 2008-09-29 15:35:13 UTC (rev 15224)
@@ -544,12 +544,9 @@
else if ( workType == WorkType.INDEX ) {
Document doc = getDocument( entity, id );
queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
- LuceneWork work = new AddLuceneWork( id, idInString, entityClass, doc );
- work.setBatch( true );
- queue.add( work );
+ queue.add( new AddLuceneWork( id, idInString, entityClass, doc, true ) );
searchForContainers = true;
}
-
else {
throw new AssertionFailure( "Unknown WorkType: " + workType );
}
Modified: search/trunk/src/java/org/hibernate/search/engine/SearchFactoryImplementor.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/engine/SearchFactoryImplementor.java 2008-09-26 18:56:55 UTC (rev 15223)
+++ search/trunk/src/java/org/hibernate/search/engine/SearchFactoryImplementor.java 2008-09-29 15:35:13 UTC (rev 15224)
@@ -3,7 +3,7 @@
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
import org.hibernate.search.SearchFactory;
import org.hibernate.search.backend.BackendQueueProcessorFactory;
@@ -51,7 +51,7 @@
Set<DirectoryProvider> getDirectoryProviders();
- Lock getDirectoryProviderLock(DirectoryProvider dp);
+ ReentrantLock getDirectoryProviderLock(DirectoryProvider dp);
void addDirectoryProvider(DirectoryProvider<?> provider);
Modified: search/trunk/src/java/org/hibernate/search/impl/SearchFactoryImpl.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/impl/SearchFactoryImpl.java 2008-09-26 18:56:55 UTC (rev 15223)
+++ search/trunk/src/java/org/hibernate/search/impl/SearchFactoryImpl.java 2008-09-29 15:35:13 UTC (rev 15224)
@@ -14,7 +14,6 @@
import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.lucene.analysis.Analyzer;
@@ -392,12 +391,12 @@
}
private static class DirectoryProviderData {
- public final Lock dirLock = new ReentrantLock();
+ public final ReentrantLock dirLock = new ReentrantLock();
public OptimizerStrategy optimizerStrategy;
public Set<Class> classes = new HashSet<Class>(2);
}
- public Lock getDirectoryProviderLock(DirectoryProvider dp) {
+ public ReentrantLock getDirectoryProviderLock(DirectoryProvider dp) {
if (barrier != 0) {} //read barrier
return this.dirProviderData.get( dp ).dirLock;
}
16 years, 3 months
Hibernate SVN: r15223 - in core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument: cases and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2008-09-26 14:56:55 -0400 (Fri, 26 Sep 2008)
New Revision: 15223
Modified:
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/buildtime/InstrumentTest.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/cases/Executable.java
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java
Log:
HHH-3498 - Fixed in Branch_3_3
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/buildtime/InstrumentTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/buildtime/InstrumentTest.java 2008-09-26 18:56:23 UTC (rev 15222)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/buildtime/InstrumentTest.java 2008-09-26 18:56:55 UTC (rev 15223)
@@ -31,7 +31,7 @@
return new TestSuite( InstrumentTest.class );
}
- public void testDirtyCheck() {
+ public void testDirtyCheck() throws Exception {
execute( new TestDirtyCheckExecutable() );
}
@@ -43,31 +43,31 @@
execute( new TestLazyExecutable() );
}
- public void testLazyManyToOne() {
+ public void testLazyManyToOne() throws Exception {
execute( new TestLazyManyToOneExecutable() );
}
- public void testSetFieldInterceptor() {
+ public void testSetFieldInterceptor() throws Exception {
execute( new TestInjectFieldInterceptorExecutable() );
}
- public void testPropertyInitialized() {
+ public void testPropertyInitialized() throws Exception {
execute( new TestIsPropertyInitializedExecutable() );
}
- public void testManyToOneProxy() {
+ public void testManyToOneProxy() throws Exception {
execute( new TestManyToOneProxyExecutable() );
}
- public void testLazyPropertyCustomTypeExecutable() {
+ public void testLazyPropertyCustomTypeExecutable() throws Exception {
execute( new TestLazyPropertyCustomTypeExecutable() );
}
- public void testSharedPKOneToOne() {
+ public void testSharedPKOneToOne() throws Exception {
execute( new TestSharedPKOneToOneExecutable() );
}
- private void execute(Executable executable) {
+ private void execute(Executable executable) throws Exception {
executable.prepare();
try {
executable.execute();
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/cases/Executable.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/cases/Executable.java 2008-09-26 18:56:23 UTC (rev 15222)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/cases/Executable.java 2008-09-26 18:56:55 UTC (rev 15223)
@@ -5,6 +5,6 @@
*/
public interface Executable {
public void prepare();
- public void execute();
+ public void execute() throws Exception;
public void complete();
}
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java 2008-09-26 18:56:23 UTC (rev 15222)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java 2008-09-26 18:56:55 UTC (rev 15223)
@@ -19,39 +19,63 @@
return new String[] { "org/hibernate/test/instrument/domain/Problematic.hbm.xml" };
}
- public void execute() {
+ public void execute() throws Exception {
Session s = getFactory().openSession();
- s.beginTransaction();
Problematic p = new Problematic();
- p.setName( "whatever" );
- p.setBytes( new byte[] { 1, 0, 1, 1, 0 } );
- s.save( p );
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ p.setName( "whatever" );
+ p.setBytes( new byte[] { 1, 0, 1, 1, 0 } );
+ s.save( p );
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
// this access should be ok because p1 is not a lazy proxy
s = getFactory().openSession();
- s.beginTransaction();
- Problematic p1 = (Problematic) s.get( Problematic.class, p.getId() );
- Assert.assertTrue( FieldInterceptionHelper.isInstrumented( p1 ) );
- p1.getRepresentation();
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.get( Problematic.class, p.getId() );
+ Assert.assertTrue( FieldInterceptionHelper.isInstrumented( p1 ) );
+ p1.getRepresentation();
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
s = getFactory().openSession();
- s.beginTransaction();
- p1 = (Problematic) s.createQuery( "from Problematic" ).setReadOnly(true ).list().get( 0 );
- p1.getRepresentation();
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.createQuery( "from Problematic" ).setReadOnly(true ).list().get( 0 );
+ p1.getRepresentation();
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
s = getFactory().openSession();
- s.beginTransaction();
- p1 = (Problematic) s.load( Problematic.class, p.getId() );
- Assert.assertFalse( FieldInterceptionHelper.isInstrumented( p1 ) );
- p1.setRepresentation( p.getRepresentation() );
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.load( Problematic.class, p.getId() );
+ Assert.assertFalse( FieldInterceptionHelper.isInstrumented( p1 ) );
+ p1.setRepresentation( p.getRepresentation() );
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
}
protected void cleanup() {
16 years, 3 months
Hibernate SVN: r15222 - in core/branches/Branch_3_2/test/org/hibernate/test/instrument: cases and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2008-09-26 14:56:23 -0400 (Fri, 26 Sep 2008)
New Revision: 15222
Modified:
core/branches/Branch_3_2/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java
core/branches/Branch_3_2/test/org/hibernate/test/instrument/cases/Executable.java
core/branches/Branch_3_2/test/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java
Log:
HHH-3498 - Fixed in Branch_3_2
Modified: core/branches/Branch_3_2/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java 2008-09-26 18:37:54 UTC (rev 15221)
+++ core/branches/Branch_3_2/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java 2008-09-26 18:56:23 UTC (rev 15222)
@@ -31,7 +31,7 @@
return new TestSuite( InstrumentTest.class );
}
- public void testDirtyCheck() {
+ public void testDirtyCheck() throws Exception {
execute( new TestDirtyCheckExecutable() );
}
@@ -43,31 +43,31 @@
execute( new TestLazyExecutable() );
}
- public void testLazyManyToOne() {
+ public void testLazyManyToOne() throws Exception {
execute( new TestLazyManyToOneExecutable() );
}
- public void testSetFieldInterceptor() {
+ public void testSetFieldInterceptor() throws Exception {
execute( new TestInjectFieldInterceptorExecutable() );
}
- public void testPropertyInitialized() {
+ public void testPropertyInitialized() throws Exception {
execute( new TestIsPropertyInitializedExecutable() );
}
- public void testManyToOneProxy() {
+ public void testManyToOneProxy() throws Exception {
execute( new TestManyToOneProxyExecutable() );
}
- public void testLazyPropertyCustomTypeExecutable() {
+ public void testLazyPropertyCustomTypeExecutable() throws Exception {
execute( new TestLazyPropertyCustomTypeExecutable() );
}
- public void testSharedPKOneToOne() {
+ public void testSharedPKOneToOne() throws Exception {
execute( new TestSharedPKOneToOneExecutable() );
}
- private void execute(Executable executable) {
+ private void execute(Executable executable) throws Exception {
executable.prepare();
try {
executable.execute();
Modified: core/branches/Branch_3_2/test/org/hibernate/test/instrument/cases/Executable.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/instrument/cases/Executable.java 2008-09-26 18:37:54 UTC (rev 15221)
+++ core/branches/Branch_3_2/test/org/hibernate/test/instrument/cases/Executable.java 2008-09-26 18:56:23 UTC (rev 15222)
@@ -5,6 +5,6 @@
*/
public interface Executable {
public void prepare();
- public void execute();
+ public void execute() throws Exception;
public void complete();
}
Modified: core/branches/Branch_3_2/test/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java 2008-09-26 18:37:54 UTC (rev 15221)
+++ core/branches/Branch_3_2/test/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java 2008-09-26 18:56:23 UTC (rev 15222)
@@ -19,39 +19,63 @@
return new String[] { "org/hibernate/test/instrument/domain/Problematic.hbm.xml" };
}
- public void execute() {
+ public void execute() throws Exception {
Session s = getFactory().openSession();
- s.beginTransaction();
Problematic p = new Problematic();
- p.setName( "whatever" );
- p.setBytes( new byte[] { 1, 0, 1, 1, 0 } );
- s.save( p );
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ p.setName( "whatever" );
+ p.setBytes( new byte[] { 1, 0, 1, 1, 0 } );
+ s.save( p );
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
// this access should be ok because p1 is not a lazy proxy
s = getFactory().openSession();
- s.beginTransaction();
- Problematic p1 = (Problematic) s.get( Problematic.class, p.getId() );
- Assert.assertTrue( FieldInterceptionHelper.isInstrumented( p1 ) );
- p1.getRepresentation();
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.get( Problematic.class, p.getId() );
+ Assert.assertTrue( FieldInterceptionHelper.isInstrumented( p1 ) );
+ p1.getRepresentation();
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
s = getFactory().openSession();
- s.beginTransaction();
- p1 = (Problematic) s.createQuery( "from Problematic" ).setReadOnly(true ).list().get( 0 );
- p1.getRepresentation();
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.createQuery( "from Problematic" ).setReadOnly(true ).list().get( 0 );
+ p1.getRepresentation();
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
s = getFactory().openSession();
- s.beginTransaction();
- p1 = (Problematic) s.load( Problematic.class, p.getId() );
- Assert.assertFalse( FieldInterceptionHelper.isInstrumented( p1 ) );
- p1.setRepresentation( p.getRepresentation() );
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.load( Problematic.class, p.getId() );
+ Assert.assertFalse( FieldInterceptionHelper.isInstrumented( p1 ) );
+ p1.setRepresentation( p.getRepresentation() );
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
}
protected void cleanup() {
16 years, 3 months
Hibernate SVN: r15221 - in core/trunk/testsuite/src/test/java/org/hibernate/test/instrument: cases and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2008-09-26 14:37:54 -0400 (Fri, 26 Sep 2008)
New Revision: 15221
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/buildtime/InstrumentTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/cases/Executable.java
core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java
Log:
HHH-3498 - Fixed in trunk
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/buildtime/InstrumentTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/buildtime/InstrumentTest.java 2008-09-26 18:37:26 UTC (rev 15220)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/buildtime/InstrumentTest.java 2008-09-26 18:37:54 UTC (rev 15221)
@@ -31,7 +31,7 @@
return new TestSuite( InstrumentTest.class );
}
- public void testDirtyCheck() {
+ public void testDirtyCheck() throws Exception {
execute( new TestDirtyCheckExecutable() );
}
@@ -43,31 +43,31 @@
execute( new TestLazyExecutable() );
}
- public void testLazyManyToOne() {
+ public void testLazyManyToOne() throws Exception {
execute( new TestLazyManyToOneExecutable() );
}
- public void testSetFieldInterceptor() {
+ public void testSetFieldInterceptor() throws Exception {
execute( new TestInjectFieldInterceptorExecutable() );
}
- public void testPropertyInitialized() {
+ public void testPropertyInitialized() throws Exception {
execute( new TestIsPropertyInitializedExecutable() );
}
- public void testManyToOneProxy() {
+ public void testManyToOneProxy() throws Exception {
execute( new TestManyToOneProxyExecutable() );
}
- public void testLazyPropertyCustomTypeExecutable() {
+ public void testLazyPropertyCustomTypeExecutable() throws Exception {
execute( new TestLazyPropertyCustomTypeExecutable() );
}
- public void testSharedPKOneToOne() {
+ public void testSharedPKOneToOne() throws Exception {
execute( new TestSharedPKOneToOneExecutable() );
}
- private void execute(Executable executable) {
+ private void execute(Executable executable) throws Exception {
executable.prepare();
try {
executable.execute();
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/cases/Executable.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/cases/Executable.java 2008-09-26 18:37:26 UTC (rev 15220)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/cases/Executable.java 2008-09-26 18:37:54 UTC (rev 15221)
@@ -5,6 +5,6 @@
*/
public interface Executable {
public void prepare();
- public void execute();
+ public void execute() throws Exception;
public void complete();
}
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java 2008-09-26 18:37:26 UTC (rev 15220)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java 2008-09-26 18:37:54 UTC (rev 15221)
@@ -19,39 +19,63 @@
return new String[] { "org/hibernate/test/instrument/domain/Problematic.hbm.xml" };
}
- public void execute() {
+ public void execute() throws Exception {
Session s = getFactory().openSession();
- s.beginTransaction();
Problematic p = new Problematic();
- p.setName( "whatever" );
- p.setBytes( new byte[] { 1, 0, 1, 1, 0 } );
- s.save( p );
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ p.setName( "whatever" );
+ p.setBytes( new byte[] { 1, 0, 1, 1, 0 } );
+ s.save( p );
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
// this access should be ok because p1 is not a lazy proxy
s = getFactory().openSession();
- s.beginTransaction();
- Problematic p1 = (Problematic) s.get( Problematic.class, p.getId() );
- Assert.assertTrue( FieldInterceptionHelper.isInstrumented( p1 ) );
- p1.getRepresentation();
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.get( Problematic.class, p.getId() );
+ Assert.assertTrue( FieldInterceptionHelper.isInstrumented( p1 ) );
+ p1.getRepresentation();
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
s = getFactory().openSession();
- s.beginTransaction();
- p1 = (Problematic) s.createQuery( "from Problematic" ).setReadOnly(true ).list().get( 0 );
- p1.getRepresentation();
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.createQuery( "from Problematic" ).setReadOnly(true ).list().get( 0 );
+ p1.getRepresentation();
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
s = getFactory().openSession();
- s.beginTransaction();
- p1 = (Problematic) s.load( Problematic.class, p.getId() );
- Assert.assertFalse( FieldInterceptionHelper.isInstrumented( p1 ) );
- p1.setRepresentation( p.getRepresentation() );
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.load( Problematic.class, p.getId() );
+ Assert.assertFalse( FieldInterceptionHelper.isInstrumented( p1 ) );
+ p1.setRepresentation( p.getRepresentation() );
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
}
protected void cleanup() {
16 years, 3 months
Hibernate SVN: r15220 - in core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument: cases and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: jcosta(a)redhat.com
Date: 2008-09-26 14:37:26 -0400 (Fri, 26 Sep 2008)
New Revision: 15220
Modified:
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/Executable.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java
Log:
HHH-3498 - Fixed in branch 3_2_4_SP1_CP
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java 2008-09-25 22:10:46 UTC (rev 15219)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java 2008-09-26 18:37:26 UTC (rev 15220)
@@ -30,7 +30,7 @@
return new TestSuite( InstrumentTest.class );
}
- public void testDirtyCheck() {
+ public void testDirtyCheck() throws Exception {
execute( new TestDirtyCheckExecutable() );
}
@@ -42,27 +42,27 @@
execute( new TestLazyExecutable() );
}
- public void testLazyManyToOne() {
+ public void testLazyManyToOne() throws Exception {
execute( new TestLazyManyToOneExecutable() );
}
- public void testSetFieldInterceptor() {
+ public void testSetFieldInterceptor() throws Exception {
execute( new TestInjectFieldInterceptorExecutable() );
}
- public void testPropertyInitialized() {
+ public void testPropertyInitialized() throws Exception {
execute( new TestIsPropertyInitializedExecutable() );
}
- public void testManyToOneProxy() {
+ public void testManyToOneProxy() throws Exception {
execute( new TestManyToOneProxyExecutable() );
}
- public void testLazyPropertyCustomTypeExecutable() {
+ public void testLazyPropertyCustomTypeExecutable() throws Exception {
execute( new TestLazyPropertyCustomTypeExecutable() );
}
- private void execute(Executable executable) {
+ private void execute(Executable executable) throws Exception {
executable.prepare();
try {
executable.execute();
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/Executable.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/Executable.java 2008-09-25 22:10:46 UTC (rev 15219)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/Executable.java 2008-09-26 18:37:26 UTC (rev 15220)
@@ -5,6 +5,6 @@
*/
public interface Executable {
public void prepare();
- public void execute();
+ public void execute() throws Exception;
public void complete();
}
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java 2008-09-25 22:10:46 UTC (rev 15219)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestLazyPropertyCustomTypeExecutable.java 2008-09-26 18:37:26 UTC (rev 15220)
@@ -19,39 +19,63 @@
return new String[] { "org/hibernate/test/instrument/domain/Problematic.hbm.xml" };
}
- public void execute() {
+ public void execute() throws Exception {
Session s = getFactory().openSession();
- s.beginTransaction();
Problematic p = new Problematic();
- p.setName( "whatever" );
- p.setBytes( new byte[] { 1, 0, 1, 1, 0 } );
- s.save( p );
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ p.setName( "whatever" );
+ p.setBytes( new byte[] { 1, 0, 1, 1, 0 } );
+ s.save( p );
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
// this access should be ok because p1 is not a lazy proxy
s = getFactory().openSession();
- s.beginTransaction();
- Problematic p1 = (Problematic) s.get( Problematic.class, p.getId() );
- Assert.assertTrue( FieldInterceptionHelper.isInstrumented( p1 ) );
- p1.getRepresentation();
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.get( Problematic.class, p.getId() );
+ Assert.assertTrue( FieldInterceptionHelper.isInstrumented( p1 ) );
+ p1.getRepresentation();
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
s = getFactory().openSession();
- s.beginTransaction();
- p1 = (Problematic) s.createQuery( "from Problematic" ).setReadOnly(true ).list().get( 0 );
- p1.getRepresentation();
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.createQuery( "from Problematic" ).setReadOnly(true ).list().get( 0 );
+ p1.getRepresentation();
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
s = getFactory().openSession();
- s.beginTransaction();
- p1 = (Problematic) s.load( Problematic.class, p.getId() );
- Assert.assertFalse( FieldInterceptionHelper.isInstrumented( p1 ) );
- p1.setRepresentation( p.getRepresentation() );
- s.getTransaction().commit();
- s.close();
+ try {
+ s.beginTransaction();
+ Problematic p1 = (Problematic) s.load( Problematic.class, p.getId() );
+ Assert.assertFalse( FieldInterceptionHelper.isInstrumented( p1 ) );
+ p1.setRepresentation( p.getRepresentation() );
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
}
protected void cleanup() {
16 years, 3 months
Hibernate SVN: r15219 - core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-09-25 18:10:46 -0400 (Thu, 25 Sep 2008)
New Revision: 15219
Modified:
core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/DB2Dialect.java
Log:
HHH-3496 : DB2 hanging on JPALockTest and CMTTest
Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/DB2Dialect.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/DB2Dialect.java 2008-09-25 22:04:01 UTC (rev 15218)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/DB2Dialect.java 2008-09-25 22:10:46 UTC (rev 15219)
@@ -393,4 +393,9 @@
public boolean supportsLobValueChangePropogation() {
return false;
}
+
+
+ public boolean doesReadCommittedCauseWritersToBlockReaders() {
+ return true;
+ }
}
16 years, 3 months
Hibernate SVN: r15218 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2008-09-25 18:04:01 -0400 (Thu, 25 Sep 2008)
New Revision: 15218
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/DB2Dialect.java
Log:
HHH-3496 : DB2 hanging on JPALockTest and CMTTest
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/DB2Dialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/DB2Dialect.java 2008-09-25 21:57:12 UTC (rev 15217)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/DB2Dialect.java 2008-09-25 22:04:01 UTC (rev 15218)
@@ -393,4 +393,8 @@
public boolean supportsLobValueChangePropogation() {
return false;
}
+
+ public boolean doesReadCommittedCauseWritersToBlockReaders() {
+ return true;
+ }
}
16 years, 3 months