WAS 6.1, JPA with JTA, Hibernate, Spring : data retrieval problem -


I am running an application with the following components:

  • Oracle 9i
  • WS and EJB was 6.1.0.23 with 3 features pack
  • JPA with Hibernate 3.3.2g with provider (Hibernation - EntityManager 3.4.0)
  • < Li> Spring Transaction Manager for WAS: UowTransactionManager (Spring 2.5.6)
  • Spring webflow, i.e. institution manager with flow-managed firmness (2.0.8) has been serialized in http session, and Everyone Is restored on request.

In every request that goes from the Web Controller to the Service Layer (annotated with the Transaction of Spring), I have seen that for every SQL query that the service within the transaction during the Hibernate service Performs during the launch, unless a new datasource is datasource free of charge and finally hangs out, the connectivity is more than the yolk datasource. Required by Barnett's connection provider.

Here are some parts of the configuration:

  1. Spring:

      & lt; Tx: annotation-driven / & gt; & Lt; Reference: component-scan base-package = "org.home.myapp" /> & Lt; Jee: jndi-lookup id = "data source" jndi-name = "jdbc / ds" resource-riff = "true" /> & Lt; Bean id = "transaction manager" class = "org.springframework.transaction.jta.WebSphereUowTransactionManager" /> & Lt; Bean id = "emf" class = "org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" & gt; & Lt; Property Name = "Data Source" Riff = "Data Sources" / & gt; & Lt; Property Name = "JPAVENDER Adapter" & gt; & Lt; Bean square = "org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" /> & Lt; / Property & gt; & Lt; / Bean & gt;  
  2. & lt; Properties & gt; & Lt; Property Name = "hibernate.archive.autodetection" value = "class" /> & Lt; Property Name = "hibernate.dialect" value = "org.hibernate.dialect.Oracle9i DialAct" / & gt; & Lt; Property Name = "hibernate.current_session_context_class" value = "jta" /> & Lt; Property Name = "hibernate.cache.provider_class" value = "org.hibernate.cache.NoCacheProvider" /> & Lt; Property Name = "hibernate.format_sql" value = "true" /> & Lt; Property Name = "hibernate.show_sql" value = "true" /> & Lt; Property Name = "hibernate.default_batch_fetch_size" value = "20" /> & Lt; Property Name = "hibernate.transaction.manager_lookup_class" value = "org.hibernate.transaction.WebSphereExtendedJTATransactionLookup" /> & Lt; / Properties & gt; & Lt; / Persistence unit & gt;

  3. service

      @transaction (read only = true) @ service public class MyServiceImpl MyService {@Autowired MyDao dao ; Public zero receiving support () {dao.findSomething (); }}  
  4. DAO

      @ Repository public class applies to Myadozap Maido {@ Precision Contact Entity Manager; Public Zero Search Some () {em.find (...); Note: Transaction is read-only, which is common to flow-persistence: Only with the final transition (committed = true) to turn on a non-conduct only transaction method readings, only that flag automatically hibernate flush mode Changes in the manual. 

    While debugging something, I noticed the following:

    • The UOH Transaction Manager has been correctly implemented in blocking a series of service, which states that Transaction is active
    • Datasource on the injected raw data source in the Hibernate EMF asks for a connection by applying the .getConnection (); The strategy for receiving connections is from Hibernate's Injection Data Connection Provider, and this class refers to WAS data source (not a proxy that is aware of active transactions or such).

    I think the problem is in this second point, but I can not find any error in my configuration. Can anyone help?

    Thank you for your help.

Configure our wild guess

  • Hibernate prop - Hibernate Connection. Really_mode = after_statement
  • web.xml resource referralsConfigurationConfig - & lt; Ridge-sharing-scope & gt; Shareable & lt; / Res-sharing
  • Spring session
  • >

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -