Hibernate SVN: r18186 - validator/branches.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-12-09 16:09:28 -0500 (Wed, 09 Dec 2009)
New Revision: 18186
Added:
validator/branches/Branch_4_0_3/
Log:
Copied validator/tags/v4_0_2_GA to validator/branches/Branch_4_0_3.
Copied: validator/branches/Branch_4_0_3 (from rev 18185, validator/tags/v4_0_2_GA)
15 years
Hibernate SVN: r18185 - core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional.
by hibernate-commits@lists.jboss.org
Author: galder.zamarreno(a)jboss.com
Date: 2009-12-09 13:21:07 -0500 (Wed, 09 Dec 2009)
New Revision: 18185
Added:
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/BasicJdbcTransactionalTestCase.java
Log:
Added JDBC transaction test.
Added: core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/BasicJdbcTransactionalTestCase.java
===================================================================
--- core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/BasicJdbcTransactionalTestCase.java (rev 0)
+++ core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/BasicJdbcTransactionalTestCase.java 2009-12-09 18:21:07 UTC (rev 18185)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and
+ * individual contributors as indicated by the @author tags. See the
+ * copyright.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.test.cache.infinispan.functional;
+
+import java.util.Map;
+
+import org.hibernate.Session;
+import org.hibernate.stat.SecondLevelCacheStatistics;
+import org.hibernate.stat.Statistics;
+import org.hibernate.transaction.JDBCTransactionFactory;
+import org.hibernate.transaction.TransactionFactory;
+import org.hibernate.transaction.TransactionManagerLookup;
+import org.infinispan.util.logging.Log;
+import org.infinispan.util.logging.LogFactory;
+
+/**
+ * BasicJdbcTransactionalTestCase.
+ *
+ * @author Galder Zamarreño
+ * @since 3.5
+ */
+public class BasicJdbcTransactionalTestCase extends SingleNodeTestCase {
+ private static final Log log = LogFactory.getLog(BasicJdbcTransactionalTestCase.class);
+
+ public BasicJdbcTransactionalTestCase(String string) {
+ super(string);
+ }
+
+ protected Class<? extends TransactionFactory> getTransactionFactoryClass() {
+ return JDBCTransactionFactory.class;
+ }
+
+ protected Class<? extends TransactionManagerLookup> getTransactionManagerLookupClass() {
+ return null;
+ }
+
+ public void testCollectionCache() throws Exception {
+ Item item = new Item("chris", "Chris's Item");
+ Item another = new Item("another", "Owned Item");
+ item.addItem(another);
+
+ Session s = null;
+ try {
+ s = openSession();
+ s.beginTransaction();
+ s.persist(item);
+ s.persist(another);
+ s.getTransaction().commit();
+ } catch (Exception e) {
+ log.error("Exception", e);
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
+
+ try {
+ s = openSession();
+ s.beginTransaction();
+ Item loaded = (Item) s.load(Item.class, item.getId());
+ assertEquals(1, loaded.getItems().size());
+ } catch (Exception e) {
+ log.error("Exception", e);
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
+
+ try {
+ s = openSession();
+ s.beginTransaction();
+ Statistics stats = s.getSessionFactory().getStatistics();
+ SecondLevelCacheStatistics cStats = stats.getSecondLevelCacheStatistics(Item.class.getName() + ".items");
+ Item loadedWithCachedCollection = (Item) s.load(Item.class, item.getId());
+ stats.logSummary();
+ assertEquals(item.getName(), loadedWithCachedCollection.getName());
+ assertEquals(item.getItems().size(), loadedWithCachedCollection.getItems().size());
+ assertEquals(1, cStats.getHitCount());
+ Map cacheEntries = cStats.getEntries();
+ assertEquals(1, cacheEntries.size());
+ } catch (Exception e) {
+ log.error("Exception", e);
+ s.getTransaction().rollback();
+ throw e;
+ } finally {
+ s.close();
+ }
+ }
+}
15 years
Hibernate SVN: r18184 - core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional.
by hibernate-commits@lists.jboss.org
Author: galder.zamarreno(a)jboss.com
Date: 2009-12-09 13:20:38 -0500 (Wed, 09 Dec 2009)
New Revision: 18184
Modified:
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java
Log:
[HHH-4520] (Infinispan second level cache integration can cache stale collection data) testManyUsers now enabled after ISPN-277 was fixed.
Modified: core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java
===================================================================
--- core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java 2009-12-09 16:18:33 UTC (rev 18183)
+++ core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java 2009-12-09 18:20:38 UTC (rev 18184)
@@ -61,7 +61,7 @@
*/
public class ConcurrentWriteTest extends SingleNodeTestCase {
private static final Log log = LogFactory.getLog(ConcurrentWriteTest.class);
-
+ private static final boolean trace = log.isTraceEnabled();
/**
* when USER_COUNT==1, tests pass, when >4 tests fail
*/
@@ -423,15 +423,21 @@
for (int i = 0; i < ITERATION_COUNT && !TERMINATE_ALL_USERS; i++) {
if (contactExists())
throw new IllegalStateException("contact already exists before add, customerId=" + customerId);
+ if (trace) log.trace("Add contact for customer " + customerId);
addContact(customerId);
+ if (trace) log.trace("Added contact");
thinkRandomTime();
if (!contactExists())
throw new IllegalStateException("contact missing after successful add, customerId=" + customerId);
thinkRandomTime();
+ if (trace) log.trace("Read all customers' first contact");
// read everyone's contacts
readEveryonesFirstContact();
+ if (trace) log.trace("Read completed");
thinkRandomTime();
+ if (trace) log.trace("Remove contact of customer" + customerId);
removeContact(customerId);
+ if (trace) log.trace("Removed contact");
if (contactExists())
throw new IllegalStateException("contact still exists after successful remove call, customerId=" + customerId);
thinkRandomTime();
Modified: core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java
===================================================================
--- core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java 2009-12-09 16:18:33 UTC (rev 18183)
+++ core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/SingleNodeTestCase.java 2009-12-09 18:20:38 UTC (rev 18184)
@@ -34,7 +34,10 @@
protected TransactionManager getTransactionManager() {
try {
- return getTransactionManagerLookupClass().newInstance().getTransactionManager(null);
+ if (getTransactionManagerLookupClass() == null)
+ return null;
+ else
+ return getTransactionManagerLookupClass().newInstance().getTransactionManager(null);
} catch (Exception e) {
log.error("Error", e);
throw new RuntimeException(e);
@@ -81,7 +84,9 @@
cfg.setProperty(Environment.USE_QUERY_CACHE, String.valueOf(getUseQueryCache()));
cfg.setProperty(Environment.CACHE_REGION_FACTORY, getCacheRegionFactory().getName());
cfg.setProperty(Environment.CONNECTION_PROVIDER, getConnectionProviderClass().getName());
- cfg.setProperty(Environment.TRANSACTION_MANAGER_STRATEGY, getTransactionManagerLookupClass().getName());
+ if (getTransactionManagerLookupClass() != null) {
+ cfg.setProperty(Environment.TRANSACTION_MANAGER_STRATEGY, getTransactionManagerLookupClass().getName());
+ }
cfg.setProperty(Environment.TRANSACTION_STRATEGY, getTransactionFactoryClass().getName());
}
15 years
Hibernate SVN: r18183 - jpamodelgen/trunk.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-12-09 11:18:33 -0500 (Wed, 09 Dec 2009)
New Revision: 18183
Modified:
jpamodelgen/trunk/pom.xml
Log:
grr
Modified: jpamodelgen/trunk/pom.xml
===================================================================
--- jpamodelgen/trunk/pom.xml 2009-12-09 16:17:46 UTC (rev 18182)
+++ jpamodelgen/trunk/pom.xml 2009-12-09 16:18:33 UTC (rev 18183)
@@ -11,7 +11,7 @@
<inceptionYear>2009</inceptionYear>
- <dependencies>c
+ <dependencies>
<dependency>
<groupId>org.hibernate.java-persistence</groupId>
<artifactId>jpa-api</artifactId>
15 years
Hibernate SVN: r18182 - jpamodelgen/trunk.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-12-09 11:17:46 -0500 (Wed, 09 Dec 2009)
New Revision: 18182
Modified:
jpamodelgen/trunk/pom.xml
Log:
corrected version
Modified: jpamodelgen/trunk/pom.xml
===================================================================
--- jpamodelgen/trunk/pom.xml 2009-12-08 23:24:39 UTC (rev 18181)
+++ jpamodelgen/trunk/pom.xml 2009-12-09 16:17:46 UTC (rev 18182)
@@ -4,14 +4,14 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
- <version>1.0.0.Beta2-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<name>JPA 2 Static-Metamodel Generator</name>
<description>Annotation Processor to generate JPA 2 static metamodel classes</description>
<inceptionYear>2009</inceptionYear>
- <dependencies>
+ <dependencies>c
<dependency>
<groupId>org.hibernate.java-persistence</groupId>
<artifactId>jpa-api</artifactId>
15 years
Hibernate SVN: r18181 - core/trunk/entitymanager.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-12-08 18:24:39 -0500 (Tue, 08 Dec 2009)
New Revision: 18181
Modified:
core/trunk/entitymanager/pom.xml
Log:
HHH-4655
Modified: core/trunk/entitymanager/pom.xml
===================================================================
--- core/trunk/entitymanager/pom.xml 2009-12-08 22:58:38 UTC (rev 18180)
+++ core/trunk/entitymanager/pom.xml 2009-12-08 23:24:39 UTC (rev 18181)
@@ -48,7 +48,7 @@
-->
<groupId>${project.groupId}</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0.Beta1</version>
<scope>test</scope>
<exclusions>
<exclusion>
15 years
Hibernate SVN: r18179 - jpamodelgen/tags.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-12-08 17:58:30 -0500 (Tue, 08 Dec 2009)
New Revision: 18179
Added:
jpamodelgen/tags/v1_0_0_Beta1/
Log:
[maven-scm] copy for tag v1_0_0_Beta1
Copied: jpamodelgen/tags/v1_0_0_Beta1 (from rev 18178, jpamodelgen/trunk)
15 years
Hibernate SVN: r18177 - jpamodelgen/trunk.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-12-08 17:55:26 -0500 (Tue, 08 Dec 2009)
New Revision: 18177
Modified:
jpamodelgen/trunk/pom.xml
Log:
updated license information
Modified: jpamodelgen/trunk/pom.xml
===================================================================
--- jpamodelgen/trunk/pom.xml 2009-12-08 22:53:55 UTC (rev 18176)
+++ jpamodelgen/trunk/pom.xml 2009-12-08 22:55:26 UTC (rev 18177)
@@ -29,7 +29,7 @@
<licenses>
<license>
<name>Apache License, Version 2.0</name>
- <url>license.txt</url>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
15 years