Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Transactions
Transactions [message #387785] Wed, 13 May 2009 10:57 Go to next message
Yolanda is currently offline YolandaFriend
Messages: 5
Registered: July 2009
Junior Member
Hello
I have a problem with transactions.
I need to invoke a method of a SessionBean within a preUpdate event of an
Entity.
public void preUpdate(DescriptorEvent event) {
Object orrFacade = new InitialContext().lookup("OrrFacadeEJB");
BigDecimal data = ((OrrFacade)orrFacade).getDataFromDB();
}
But if I do it I obtain this exception:
"javax.transaction.SystemException: Only one single phase commit resource
may be enlisted in a transaction"
How could I do it?
Thanks for your help:
Yolanda.
Re: Transactions [message #387790 is a reply to message #387785] Wed, 13 May 2009 14:16 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Does the SessionBean access another database? It looks like your JTA
driver cannot create an XA transaction across these two data-sources.
Maybe change the transaction attribute of the SessionBean method to avoid
a transaction, or start a new transaction (not_supports or requires_new I
think).

If it is the same DataSource, then that is odd. Ensure the SessionBean is
a local SessionBean.

---
James
http://www.nabble.com/EclipseLink---Users-f26658.html


James : Wiki : Book : Blog : Twitter
Re: Transactions [message #387925 is a reply to message #387790] Fri, 15 May 2009 13:31 Go to previous messageGo to next message
Yolanda is currently offline YolandaFriend
Messages: 5
Registered: July 2009
Junior Member
Hello James, thanks for your replay.
When I do a lookup in the preUpdate method of a entity, I get a Remote
sessionBean, I can't understand why this is happening,
and I don't know how I can fix it.
Any idea?
Re: Transactions [message #387939 is a reply to message #387925] Tue, 19 May 2009 17:52 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

You can make a SessionBean local by using @Local instead of @Remote in the
SessionBean class.


James : Wiki : Book : Blog : Twitter
Re: Transactions [message #389705 is a reply to message #387939] Mon, 22 June 2009 11:06 Go to previous message
Yolanda is currently offline YolandaFriend
Messages: 5
Registered: July 2009
Junior Member
Hi James.
I initialized wrong the InitialContext.
Thanks
Previous Topic:fetch multi-level relations
Next Topic:toplink console, JMX
Goto Forum:
  


Current Time: Sun May 05 11:07:48 GMT 2024

Powered by FUDForum. Page generated in 0.03183 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top