[jBPM] - Re: In memory TaskClient without Mina or JMS
by Daniele Ulrich
Daniele Ulrich [http://community.jboss.org/people/daniele.ulrich] created the discussion
"Re: In memory TaskClient without Mina or JMS"
To view the discussion, visit: http://community.jboss.org/message/617232#617232
--------------------------------------------------------------
Hi Franklin
Thanks for posting your (very detailled) findings back to the community. As you were able to use the human task service within JTA transaction boundaries maybe we will try the same within a JEE application (and not with Spring).
1. persistence unit: we had to change the file name for the orm.xml file to something like orm-human-task-service.xml; orm.xml is the default file name and it seems that it will be taken from ANY persistence unit that has access to it. So it could save you some headache if you are using
*<mapping-file>*META-INF/orm-human-task-service.xml*</mapping-file>*
2. you can get the source for jbpm here https://github.com/droolsjbpm/jbpm.git https://github.com/droolsjbpm/jbpm.git (JBoss Tools provides a GIT Client for eclipse, or you can use TortoiseGIT). I started with my patch from Tag 5.0.0, now already 5.1.0-Final is available. I already attached the sources of my patch in my last post. You just have to concentrate at org.jbpm.task.service.TaskService and org.jbpm.task.service.TaskServiceSession where I had to change the handling of the EntityManager (transaction begin, commit, rollback, entityManager.close).
3. As in org.jbpm.task.service.TaskServiceSession a rather strange transaction handling was implemented and I had not enough time to inspect all call stacks in detail, I decided to use some kind of a hack to create the EnttityManager with the help of threadLocalStorage. If you can guarantee that your taskServiceSession is always created and disposed within the same thread and exclusively used by this one and only thread you could make the implementation somewhat simpler by using a simple instance variable for the entityManager. As far as I know the taskServiceSession is not thread safe anyway. My hack ensures that every thread will have an entityManager of its own and that it is only one time created even if a call causes multiple actions on the entityManager - but you have to make sure that threadLocalStorage is freed after closing the session.
Please keep us up to date; I will try to get in contact with the responsible developers for this sub project if we really decide to use this library in our project. Currently we are discussing to write it completely from scratch because it has not so many features implemented or is this mature that we could not do the same in a couple of days. I think the whole architecture should be reconsidered, with a pure business core and several providers for the different contexts this service could be running in.
Regards
Daniele
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/617232#617232]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months
[EJB3] - JBoss AS 7.0.0.Final And EJB 3.1 Times Service Problem
by Paata Lominadze
Paata Lominadze [http://community.jboss.org/people/paata] created the discussion
"JBoss AS 7.0.0.Final And EJB 3.1 Times Service Problem"
To view the discussion, visit: http://community.jboss.org/message/617234#617234
--------------------------------------------------------------
Hi all,
I'm trying to test simple example about timer service.
1.Application Server :
| 7.0.0.Final | Lightning | Web Profile Only (*Java EE6 Certified*) |
2. Here is Code Example
@Singleton
@Startup
@LocalBean
public class SMSSender {
@PostConstruct
@Schedules({ @Schedule(hour = "*", minute = "*", second = "*/5"),
@Schedule(hour = "*", minute = "*", second = "*/10") })
public void myStart() {
System.out.println("Start ....................");
System.out.println(getClass().getName() + ": " + new Date());
System.out.println("Finished ....................");
}
}
But output printed only once :
17:20:48,639 INFO [stdout] (MSC service thread 1-5) Start ....................
17:20:48,640 INFO [stdout] (MSC service thread 1-5) com.info.billing.sms.messages.beans.sessoin.SMSSender: Sun Jul 24 17:20:48 GET 2011
17:20:48,640 INFO [stdout] (MSC service thread 1-5) Finished ....................
Did I miss something or EJB 3.1 Features is not implemented on JBoss AS 7.0.0.Final yet ?
_____________________
Regards,
Paata Lominadze.
Magticom LTD.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/617234#617234]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 8 months