cancel
Showing results for 
Search instead for 
Did you mean: 

Set Hibernate Session as Process Variable

golden_boy_t
Champ in-the-making
Champ in-the-making
Hi
I Need Open Hibernate Session in one Service Task and close it in end of process. So how can i do this? Can I Set the session As a Process Variable in first "Service Task" and get it in second "Service Task" ? Something like this

public class ServiceTask1 implements JavaDelegate
{
   @Override
   public void execute(DelegateExecution arg0) throws Exception
   {
                      ….
                     arg0.setVariable("myVar", session);
                     …
   }
}
———————————————————————————-
public class ServiceTask2 implements JavaDelegate
{
   @Override
   public void execute(DelegateExecution arg0) throws Exception
   {
                      ….
                     ((Session)arg0.getVariable("myVar")).close();
                     …
   }
}

Best Regards
1 REPLY 1

golden_boy_t
Champ in-the-making
Champ in-the-making
no comment