Here is more context around it. The transactions are getting commited, but no dice.
Test case
------------------------------------------
Code:
public void testSearch() throws ModelValidationException{
user.setFirstName("james");
organization.addUser(user);
organizationService.add(organization);
assertTrue("Search Found nothing",userService.search("james").size() > 0);
}
-----------------------------------------------------------------------------------------
Logs for organizationService.add(organization);
-----------------------------------------------------------------------------------------
2009-02-24 11:38:45,452 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@366412da]
2009-02-24 11:38:45,452 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@366412da]
2009-02-24 11:38:45,452 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@366412da]
2009-02-24 11:38:45,454 [main] DEBUG
org.springframework.orm.hibernate3.HibernateTransactionManager - Creating new transaction with name [com.greatMorning.service.OrganizationService.add]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2009-02-24 11:38:45,454 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Creating new transaction with name [com.greatMorning.service.OrganizationService.add]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2009-02-24 11:38:45,454 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Creating new transaction with name [com.greatMorning.service.OrganizationService.add]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2009-02-24 11:38:45,546 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:38:45,546 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:38:45,546 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:38:45,554 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Not preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@1817fe89]
2009-02-24 11:38:45,554 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Not preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@1817fe89]
2009-02-24 11:38:45,554 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Not preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@1817fe89]
2009-02-24 11:38:45,637 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.commons.dbcp.PoolableConnection@7f23663b]
2009-02-24 11:38:45,637 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.commons.dbcp.PoolableConnection@7f23663b]
2009-02-24 11:38:45,637 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.commons.dbcp.PoolableConnection@7f23663b]
2009-02-24 11:38:58,250 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:38:58,250 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:38:58,250 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:38:58,251 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@e7587b2]
2009-02-24 11:38:58,251 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@e7587b2]
2009-02-24 11:38:58,251 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@e7587b2]
2009-02-24 11:38:58,252 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Suspending current transaction, creating new transaction with name [com.greatMorning.service.UserService.isUniqueUser]
2009-02-24 11:38:58,252 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Suspending current transaction, creating new transaction with name [com.greatMorning.service.UserService.isUniqueUser]
2009-02-24 11:38:58,252 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Suspending current transaction, creating new transaction with name [com.greatMorning.service.UserService.isUniqueUser]
2009-02-24 11:38:58,258 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@3f68336] for Hibernate transaction
2009-02-24 11:38:58,258 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@3f68336] for Hibernate transaction
2009-02-24 11:38:58,258 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@3f68336] for Hibernate transaction
2009-02-24 11:38:58,259 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Not preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@3f68336]
2009-02-24 11:38:58,259 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Not preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@3f68336]
2009-02-24 11:38:58,259 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Not preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@3f68336]
2009-02-24 11:38:58,320 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.commons.dbcp.PoolableConnection@ab612f8]
2009-02-24 11:38:58,320 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.commons.dbcp.PoolableConnection@ab612f8]
2009-02-24 11:38:58,320 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.commons.dbcp.PoolableConnection@ab612f8]
2009-02-24 11:38:58,345 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@3f68336] for Hibernate transaction
2009-02-24 11:38:58,345 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@3f68336] for Hibernate transaction
2009-02-24 11:38:58,345 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@3f68336] for Hibernate transaction
2009-02-24 11:38:58,346 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@37975d46]
2009-02-24 11:38:58,346 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@37975d46]
2009-02-24 11:38:58,346 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@37975d46]
2009-02-24 11:38:58,346 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Participating in existing transaction
2009-02-24 11:38:58,346 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Participating in existing transaction
2009-02-24 11:38:58,346 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Participating in existing transaction
Hibernate: select user0_.id as id1_, user0_.city as city1_, user0_.createDate as createDate1_, user0_.firstName as firstName1_, user0_.lastName as lastName1_, user0_.password as password1_, user0_.role as role1_, user0_.state_id as state11_1_, user0_.updateDate as updateDate1_, user0_.userName as userName1_, user0_.zipCode as zipCode1_, user0_1_.customerNumber as customer1_2_, user0_2_.organization_id as organiza4_7_, user0_2_.primary_user as primary1_7_, user0_2_.uuid as uuid7_, case when user0_1_.userId is not null then 1 when user0_2_.userId is not null then 2 when user0_.id is not null then 0 end as clazz_ from User user0_ left outer join ClientUser user0_1_ on user0_.id=user0_1_.userId left outer join OrganizationUser user0_2_ on user0_.id=user0_2_.userId where user0_.userName=?
2009-02-24 11:38:58,411 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
2009-02-24 11:38:58,411 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
2009-02-24 11:38:58,411 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
2009-02-24 11:38:58,414 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
2009-02-24 11:38:58,414 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
2009-02-24 11:38:58,414 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
2009-02-24 11:38:58,415 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
2009-02-24 11:38:58,415 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
2009-02-24 11:38:58,415 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
2009-02-24 11:38:58,415 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@3f68336]
2009-02-24 11:38:58,415 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@3f68336]
2009-02-24 11:38:58,415 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@3f68336]
2009-02-24 11:38:58,417 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCommit synchronization
2009-02-24 11:38:58,417 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCommit synchronization
2009-02-24 11:38:58,417 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCommit synchronization
2009-02-24 11:38:58,421 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
2009-02-24 11:38:58,421 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
2009-02-24 11:38:58,421 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
2009-02-24 11:38:58,422 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@3f68336] after transaction
2009-02-24 11:38:58,422 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@3f68336] after transaction
2009-02-24 11:38:58,422 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@3f68336] after transaction
2009-02-24 11:38:58,429 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Resuming suspended transaction
2009-02-24 11:38:58,429 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Resuming suspended transaction
2009-02-24 11:38:58,429 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Resuming suspended transaction
2009-02-24 11:38:59,045 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:38:59,045 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:38:59,045 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:38:59,046 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@18f55759]
2009-02-24 11:38:59,046 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@18f55759]
2009-02-24 11:38:59,046 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@18f55759]
2009-02-24 11:38:59,047 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Participating in existing transaction
2009-02-24 11:38:59,047 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Participating in existing transaction
2009-02-24 11:38:59,047 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Participating in existing transaction
Hibernate: insert into Organization (active, createDate, name, updateDate, uuid) values (?, ?, ?, ?, ?)
Hibernate: insert into User (city, createDate, firstName, lastName, password, role, state_id, updateDate, userName, zipCode) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into OrganizationUser (organization_id, primary_user, uuid, userId) values (?, ?, ?, ?)
Hibernate: insert into EmailAddress (host, localPart, primary_email) values (?, ?, ?)
Hibernate: insert into PhoneNumber (areaCode, phoneNumber, primary_phone, type) values (?, ?, ?, ?)
2009-02-24 11:39:00,757 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:39:00,757 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:39:00,757 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Found thread-bound Session [org.hibernate.impl.SessionImpl@1817fe89] for Hibernate transaction
2009-02-24 11:39:00,758 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@40f92a41]
2009-02-24 11:39:00,758 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@40f92a41]
2009-02-24 11:39:00,758 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@40f92a41]
2009-02-24 11:39:00,759 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Participating in existing transaction
2009-02-24 11:39:00,759 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Participating in existing transaction
2009-02-24 11:39:00,759 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Participating in existing transaction
Hibernate: insert into AuditLog (auditType, createDate, entityClass, entityId, message, who_id) values (?, ?, ?, ?, ?, ?)
2009-02-24 11:39:03,915 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
2009-02-24 11:39:03,915 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
2009-02-24 11:39:03,915 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
2009-02-24 11:39:03,916 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
2009-02-24 11:39:03,916 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
2009-02-24 11:39:03,916 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
2009-02-24 11:39:03,916 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
2009-02-24 11:39:03,916 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
2009-02-24 11:39:03,916 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
2009-02-24 11:39:03,916 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@1817fe89]
2009-02-24 11:39:03,916 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@1817fe89]
2009-02-24 11:39:03,916 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@1817fe89]
Hibernate: insert into organization_users (organization_id, user_id) values (?, ?)
Hibernate: insert into UserEmailAddresses (user_id, email_address_id) values (?, ?)
Hibernate: insert into UserPhoneNumbers (user_id, phone_number_id) values (?, ?)
2009-02-24 11:39:03,941 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCommit synchronization
2009-02-24 11:39:03,941 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCommit synchronization
2009-02-24 11:39:03,941 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCommit synchronization
2009-02-24 11:39:03,942 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
2009-02-24 11:39:03,942 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
2009-02-24 11:39:03,942 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
2009-02-24 11:39:03,942 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@1817fe89] after transaction
2009-02-24 11:39:03,942 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@1817fe89] after transaction
2009-02-24 11:39:03,942 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@1817fe89] after transaction
-----------------------------------------------------------
Logs for userDAO.search
-----------------------------------------------------------
2009-02-24 11:42:25,721 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@5d86aad9]
2009-02-24 11:42:25,721 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@5d86aad9]
2009-02-24 11:42:25,721 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Using transaction object [org.springframework.orm.hibernate3.HibernateTransactionManager$HibernateTransactionObject@5d86aad9]
2009-02-24 11:42:25,723 [main] DEBUG
org.springframework.orm.hibernate3.HibernateTransactionManager - Creating new transaction with name [com.greatMorning.dao.UserDAO.search]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2009-02-24 11:42:25,723 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Creating new transaction with name [com.greatMorning.dao.UserDAO.search]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2009-02-24 11:42:25,723 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Creating new transaction with name [com.greatMorning.dao.UserDAO.search]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2009-02-24 11:42:25,724 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@343abc87] for Hibernate transaction
2009-02-24 11:42:25,724 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@343abc87] for Hibernate transaction
2009-02-24 11:42:25,724 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@343abc87] for Hibernate transaction
2009-02-24 11:42:25,725 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Not preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@343abc87]
2009-02-24 11:42:25,725 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Not preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@343abc87]
2009-02-24 11:42:25,725 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Not preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@343abc87]
2009-02-24 11:42:25,727 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.commons.dbcp.PoolableConnection@451dfada]
2009-02-24 11:42:25,727 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.commons.dbcp.PoolableConnection@451dfada]
2009-02-24 11:42:25,727 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [org.apache.commons.dbcp.PoolableConnection@451dfada]
2009-02-24 11:42:25,731 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
2009-02-24 11:42:25,731 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
2009-02-24 11:42:25,731 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCommit synchronization
2009-02-24 11:42:25,732 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
2009-02-24 11:42:25,732 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
2009-02-24 11:42:25,732 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering beforeCompletion synchronization
2009-02-24 11:42:25,733 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
2009-02-24 11:42:25,733 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
2009-02-24 11:42:25,733 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Initiating transaction commit
2009-02-24 11:42:25,734 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@343abc87]
2009-02-24 11:42:25,734 [main] DEBUG
org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@343abc87]
2009-02-24 11:42:25,734 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@343abc87]
2009-02-24 11:42:25,735 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCommit synchronization
2009-02-24 11:42:25,735 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCommit synchronization
2009-02-24 11:42:25,735 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCommit synchronization
2009-02-24 11:42:25,736 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
2009-02-24 11:42:25,736 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
2009-02-24 11:42:25,736 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Triggering afterCompletion synchronization
2009-02-24 11:42:25,737 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@343abc87] after transaction
2009-02-24 11:42:25,737 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@343abc87] after transaction
2009-02-24 11:42:25,737 [main] DEBUG org.springframework.orm.hibernate3.HibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@343abc87] after transaction
Relevant applicationContext.xml fragment
----------------------------------------------------------------------
Code:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
lazy-init="true" autowire-candidate="false">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="maxActive" value="100" />
<property name="url" value="${hibernate.connection.url}" />
<property name="username" value="${hibernate.connection.username}" />
<property name="password" value="${hibernate.connection.password}" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
<prop key="hibernate.connection.release_mode">${hibernate.connection.release_mode}
</prop>
<prop key="hibernate.search.default.directory_provider">${hibernate.search.default.directory_provider}</prop>
<prop key="hibernate.search.default.indexBase">${hibernate.search.default.indexBase}</prop>
</props>
</property>
<property name="annotatedClasses">
<list>
........
</list>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<!-- This tells Spring to activate annotation-driven transactions -->
<tx:annotation-driven transaction-manager="transactionManager"/>
OrganizationService.java
--------------------------------------------------------------
Code:
@Transactional(propagation = Propagation.REQUIRES_NEW, isolation = Isolation.DEFAULT, readOnly = true)
public class OrganizationServiceImpl implements OrganizationService {
@Transactional(readOnly = false)
public Organization add(Organization organization) throws ModelValidationException {
...........
}
UserService.java
----------------------------------------------------------
Code:
@Transactional(propagation = Propagation.REQUIRES_NEW, isolation = Isolation.DEFAULT, readOnly = true, rollbackFor = Throwable.class)
public class UserServiceImpl implements UserService {
private UserDAO userDAO;
public List<User> search(String keyword) {
return userDAO.search(keyword);
}