Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring ReadOnly Transaction with Propagation.SUPPORTS with WebSphere and Oracle
    primarykey
    data
    text
    <p>I have some problems with Transaction/Session management, since I switched from Hibernate 3.6 to Hibernate 4.1.x</p> <p>I use Spring 3.1.2, Hibernate 4.1.4, WebSphere 8.5 and Oracle 11.</p> <p>In my WebApp I have marked some methods with:</p> <pre><code>@Transactional(propagation = Propagation.SUPPORTS, readOnly = true) </code></pre> <p>Thats working fine for my webapp which uses OpenSessionInViewFilter and getSessionFactory().getCurrentSession().</p> <p>But some of my code is called by JMS or Quartz job (without the OpenSessionInViewFilter) resulting in</p> <pre><code>org.hibernate.HibernateException: No Session found for current thread at org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:97) </code></pre> <p>After some researches in the Internet I changed my Transaction to :</p> <pre><code>@Transactional(propagation = Propagation.REQUIRED, readOnly = true) </code></pre> <p>Now there is an open Session and everything is OK for Tomcat but on WebSphere I get the following error:</p> <pre><code>[SqlExceptionHelper] : SQL Error: 0, SQLState: null [SqlExceptionHelper] : DSRA9010E: 'setReadOnly' wird in der WebSphere-Implementierung java.sql.Connection nicht unterstützt. </code></pre> <p>Some posts say, Oracle isn´t supporting readonly. But with Propagation.SUPPORTS or with Tomcat it´s working. Now I don´t know what to do. Marking all methods called by JMS with Propagation.REQUIRED and readOnly = false?</p> <p>Any better ideas? Or is this a bug in Spring when using WebSphere?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload