[jpos-users] Instances of TransactionParticipant

View: New views
3 Messages — Rating Filter:   Alert me  

[jpos-users] Instances of TransactionParticipant

by Sumeet Phadnis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

Does the TransactionManager create different instances of
TransactionParticipant classes during different phases like prepare /
commit / abort?

Or the instance created in prepare phase of a particular transaction
gets reused during commit / abort of the same transaction?

In short, what I want to know is that if the participant object sets
some local variables during prepare phase, would that stuff be
available during commit / abort? If not, I guess such things will have
to be put into Context. In my case such information can be re-
calculated, just wanted to save overhead of putting things in the
Context.

Thanks,
Sumeet
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the  "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-users@...
To unsubscribe, send email to jpos-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jpos-users
-~----------~----~----~----~------~----~------~--~---


[jpos-users] Re: Instances of TransactionParticipant

by Alejandro Revilla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Does the TransactionManager create different instances of
TransactionParticipant classes during different phases like prepare /
commit / abort?
 
Or the instance created in prepare phase of a particular transaction
gets reused during commit / abort of the same transaction?

None of the above, the participants are instantiated at initialization time and reused in all transactions.


In short, what I want to know is that if the participant object sets
some local variables during prepare phase, would that stuff be
available during commit / abort? If not, I guess such things will have
to be put into Context. In my case such information can be re-
calculated, just wanted to save overhead of putting things in the
Context.

You need to place them in the Context, or ThreadLocal if you don't PAUSE the transaction (reason is it could be resumed in another thread).

Hope this helps.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the  "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-users@...
To unsubscribe, send email to jpos-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jpos-users
-~----------~----~----~----~------~----~------~--~---


[jpos-users] Re: Instances of TransactionParticipant

by Sumeet Phadnis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Yes it does help. Thanks!

On Oct 3, 10:42 pm, Alejandro Revilla <a...@...> wrote:

> > Does the TransactionManager create different instances of
> > TransactionParticipant classes during different phases like prepare /
> > commit / abort?
>
> > Or the instance created in prepare phase of a particular transaction
> > gets reused during commit / abort of the same transaction?
>
> > None of the above, the participants are instantiated at initialization time
>
> and reused in all transactions.
>
>  In short, what I want to know is that if the participant object sets> some local variables during prepare phase, would that stuff be
> > available during commit / abort? If not, I guess such things will have
> > to be put into Context. In my case such information can be re-
> > calculated, just wanted to save overhead of putting things in the
> > Context.
>
> > You need to place them in the Context, or ThreadLocal if you don't PAUSE
>
> the transaction (reason is it could be resumed in another thread).
>
> Hope this helps.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the  "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-users@...
To unsubscribe, send email to jpos-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jpos-users
-~----------~----~----~----~------~----~------~--~---