Quantcast

To TransactionAttributeType.NOT_SUPPORTED or not to TransactionAttributeType.NOT_SUPPORTED

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

To TransactionAttributeType.NOT_SUPPORTED or not to TransactionAttributeType.NOT_SUPPORTED

Tom Rowe
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: To TransactionAttributeType.NOT_SUPPORTED or not to TransactionAttributeType.NOT_SUPPORTED

kwsutter
Administrator
Hi Tom,
Sorry that I missed this one...  Maybe you have already figured out the
answer...

First off, JPA does not play into your transaction timeout or suspension
processing.  All of that is part of the WebSphere application server
processing, so I would reference the InfoCenter for more definitive answers
[1].

But, I do know that any active transaction will be suspended when a
NOT_SUPPORTED method is encountered.  So, any time that your innerMethod is
invoked, the current transaction would be suspended.  As far as whether the
timer keeps running, I would guess "yes", but I think you need some JTA
experts to be sure.

HTH,
Kevin

[1]
http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/topic/com.ibm.websphere.express.iseries.doc/info/iseriesexp/ae/tjta_settlog.html

On Wed, Jan 25, 2012 at 9:20 PM, Tom Rowe <
[hidden email]> wrote:

> 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.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: To TransactionAttributeType.NOT_SUPPORTED or not to TransactionAttributeType.NOT_SUPPORTED

Tom Rowe
Kevin:

Thank you for your insights.  This helps a lot.

Cheers,

Tom

On Fri, Feb 3, 2012 at 3:09 PM, Kevin Sutter [via OpenJPA] <[hidden email]> wrote:
Hi Tom,
Sorry that I missed this one...  Maybe you have already figured out the
answer...

First off, JPA does not play into your transaction timeout or suspension
processing.  All of that is part of the WebSphere application server
processing, so I would reference the InfoCenter for more definitive answers
[1].

But, I do know that any active transaction will be suspended when a
NOT_SUPPORTED method is encountered.  So, any time that your innerMethod is
invoked, the current transaction would be suspended.  As far as whether the
timer keeps running, I would guess "yes", but I think you need some JTA
experts to be sure.

HTH,
Kevin

[1]
http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/topic/com.ibm.websphere.express.iseries.doc/info/iseriesexp/ae/tjta_settlog.html

On Wed, Jan 25, 2012 at 9:20 PM, Tom Rowe <
[hidden email]> wrote:

> 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.
>



To unsubscribe from To TransactionAttributeType.NOT_SUPPORTED or not to TransactionAttributeType.NOT_SUPPORTED, click here.
NAML

Loading...