openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Rowe <charles.paisley.the.baby.crus...@gmail.com>
Subject To TransactionAttributeType.NOT_SUPPORTED or not to TransactionAttributeType.NOT_SUPPORTED
Date Thu, 26 Jan 2012 03:20:42 GMT
Greetings to my former JPA friends.  I have a few questions about
TransactionAttributeType.NOT_SUPPORTED.
My environment is WAS v7, but I think it matters not.
Here's the setup..

- - - - - - - - - - - - - - - - - - - - - - 

@Stateless
public class OuterService implements IOuterService {

    @PersistenceContext( unitName = "OuterService" )
    EntityManager em;

    @EJB( name = "ejblocal:com.mycompany.mypackage.IInnerService" )
    IInnerService innerService;
    
    ....
    
    public Object outerMethod() throws Exception {
       ...
       innerService.innerMethod();
       ...
    }
}

- - - - - - - - - - - - - - - - - - - - - - 

package com.mycompany.mypackage;
@Stateless
public class InnerService implements IInnerService {

    @PersistenceContext( unitName = "OuterService" ) 
    EntityManager em; // PC matches!
    
    ....
    
    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    public Object innerMethod() throws Exception {
       ...
    }
}

- - - - - - - - - - - - - - - - - - - - - - 

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
	version="2.0">
	<persistence-unit name="OuterService">
		<jta-data-source>MY-JTA-DATA-SOURCE</jta-data-source>
		<class>...</class>
                ...
		<properties>
			<property name="javax.persistence.jdbc.user" value="me" />
			<property name="javax.persistence.jdbc.password" value="password" />
			<property name="openjpa.jdbc.SynchronizeMappings" value="validate" />
		</properties>
	</persistence-unit>
</persistence>

- - - - - - - - - - - - - - - - - - - - - - 

Questions:
1. Do WebSphere transaction timeouts (default=120 secs) get suspended across
calls to innerMethod() because of TransactionAttributeType.NOT_SUPPORTED?
2. Do WebSphere transaction timeouts get suspended across calls to
outerMethod() when/if innerService.innerMethod() is invoked?

Thanks, in advance for your time and consideration..

Tom Rowe

--
View this message in context: http://openjpa.208410.n2.nabble.com/To-TransactionAttributeType-NOT-SUPPORTED-or-not-to-TransactionAttributeType-NOT-SUPPORTED-tp7225877p7225877.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message