0

In our solution there are a number of stateless session beans that implement CXF SOAP services or RESTEasy endpoints.

Like this:

@Path( "/" )
@Stateless
@TransactionAttribute( TransactionAttributeType.NEVER )
public class ValidationBean {
// ...
}

I've some beans that actually don't need a transaction, like the one above. So I applied: @TransactionAttribute( TransactionAttributeType.NEVER ).

For others (mainly the CXF SOAP endpoints) I explicitly added @TransactionTimeout( 300 ).

When doing this I wondered what timeout configuration would be used to the method calls on these REST endpoints. I thought there should be none, since there's no transaction anymore. But apparently there still are. These seem to be shorter than the default transaction timeout (our regression tests start to fail on lengthy REST Request, still need to investigate).

Questions:

  1. When you explicitly desire no transaction @TransactionAttribute( TransactionAttributeType.NEVER ) does @TransactionTimeout( 300 ) still apply?
  2. If not, which other time out becomes active?
  3. If not, can I configure this with some kind of annotation?

Exception on the REST call:

ERROR [io.undertow.request] (default task-19) UT005023: Exception handling request to /validation/cpt/rest/correct/27376655: org.jboss.resteasy.spi.UnhandledException: javax.ejb.EJBException: org.hibernate.LazyInitializationException: could not initialize proxy [nl.broservices.entities.sss.cpt.DeliveredVertPositionEntity#197769336] - no Session
Sjaak
  • 3,602
  • 17
  • 29
  • If you don't have a transaction, how would it time out? If you're getting a timeout, read the messages instead of assuming it's some kind of a ghost transaction timeout. – Kayaman Apr 21 '22 at 06:16
  • good point.. I'll add the exception. The hibernate session seems to be gone. – Sjaak Apr 21 '22 at 06:19
  • You're accessing lazy loaded references that require a session to be present. You've declared that there isn't going to be a session present. Trouble ensues. Either eagerly load those references, or have a transactional context present (whichever is the correct thing to do logically). – Kayaman Apr 21 '22 at 06:54

0 Answers0