If you move the logic into your Manager, you should be able to execute
both calls in the same transaction.
Matt
On 3/2/08, sudheerp <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> Can somebody show me some piece of code to show how to make both the
> updations
> take place under same transaction?
>
> internalEvaluationManager.saveInternalEvaluation(internalEvaluation);
> String manuscriptId =
>
> (String)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("manuscript_id_p");
> manuscript = manuscriptManager.getManuscript(manuscriptId); //
> manuscriptManager is DI
> String processId =
>
> (String)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("process_id");
> manuscript.setStatus(Integer.valueOf(processId));
> manuscriptManager.saveManuscript(manuscript);
>
> Thank you.
>
> Sudheer
>
>
>
>
> mraible wrote:
> >
> > Transactions are started in the manager methods by default, so no -
> > they won't be in the same transaction. However, if you're using OSIV,
> > it's possible the will be.
> >
> > Matt
> >
> > On 9/12/07, sudheerp <[EMAIL PROTECTED]> wrote:
> >>
> >> Hello,
> >>
> >> I am using appfuse-jsf 1.9.4.
> >>
> >> In the following save function, whenever an internalEvaluation details
> >> is
> >> inserted I am updating
> >> the manuscript status. My question is will this insert and update comes
> >> under same transaction?
> >>
> >> public String save()
> >> {
> >> boolean isNew = (internalEvaluation.getId() == null);
> >>
> >> internalEvaluationManager.saveInternalEvaluation(internalEvaluation);
> >> String key = (isNew) ? "internalEvaluation.added" :
> >> "internalEvaluation.updated";
> >> addMessage(key);
> >>
> >> String manuscriptId =
> >>
> (String)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(
> >> "manuscript_id_p");
> >> manuscript = manuscriptManager.getManuscript(manuscriptId);
> >> String processId =
> >>
> (String)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(
> >> "process_id");
> >> manuscript.setStatus(Integer.valueOf(processId));
> >> manuscriptManager.saveManuscript(manuscript);
> >> if (isNew)
> >> {
> >> return "list";
> >> }
> >> else
> >> {
> >> return "edit";
> >> }
> >> }
> >>
> >> Thank you.
> >>
> >> Sudheer
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/hibernate-transaction-question---tf4430121s2369.html#a12638078
> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > http://raibledesigns.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
> --
> View this message in context:
> http://www.nabble.com/hibernate-transaction-question---tp12638078s2369p15785985.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]