[EJB 3.0] - Re: Transactions Question: Subsequent calls the method fail
by jaikiran
"lpmon" wrote : Thanks for the input. I have never heard that you must use the proxy in this scenario. I have seen this statement (from JBoss trailbalzer):
|
| "In EJB 3.0 applications, transaction properties are most frequently declared for methods in session beans. If a method requires transaction, all operations in the method, including database updates, are only committed after the method exits normally."
|
| If it is true that a proxy based call is required then it would be very important to include that in or near the above paragraph. Where is this documented? I would like to read up on this.
|
If you are calling a method from within the bean (without using the proxy or what's called the EJBObject in EJB2.x terms) then it will be just another java method invocation. No new transactions will be started even if the transaction attribute on the method being called is REQUIRES_NEW. You might find this explained in a J2EE book.
"lpmon" wrote :
| I made a change to use the proxy call and I still get the same exact result!
|
|
| The fact that the same em is used between calls is probably the root cause.
I see what you are saying. I always thought that when a new transaction is started, a *new instance* of the container managed entitymanager will be injected. I will have to read the specs to understand what's the expected behaviour.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4157984#4157984
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4157984
17 years, 10 months
[JBoss jBPM] - Re: TaskInstance.setActorId(String) causes set TaskInstance
by Octomac
Well, this morning, I redid my Process file to assign PooledActors to tasks instead of just Actors. I was able to get the newly-created tasks to show up fine in the Group menu, but unfortunately, I'm still experiencing the same two problems I had before: the task can be assigned, but doing so sets ISCANCELLED, ISSUSPENDED, ISOPEN, ISSIGNALLING, and ISBLOCKING all to TRUE, which causes it to not be displayed in the user's task list, and both task lists are not being updated until I redeploy the application.
As before, the data appears committed to the database, so I assume the transaction is working somewhat correctly, if not entirely. While those five boolean flags are being set incorrectly, the task's ACTORID column is still updated to show the current user.
How does JBPM/Hibernate actually decide when to query the database? That is, when I call getTaskInstances(userId), does it use cached data somewhere? I suppose it must, because the same data shows up in my UI even after I've changed it at the database level. Can I force it to hit up the database every time that method is called, perhaps as a setting in the hibernate.cfg.xml?
On the upshot, I was mistaken about how PooledActors work, so kudos for helping me clear that much up! If anyone has any further suggestions on my issues, I'd greatly appreciate it. Thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4157983#4157983
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4157983
17 years, 10 months
[JCA/JBoss] - Re: Idle timeout minutes not working? Database connection do
by mkaul
Hi,
I have a similar problem while setting up oracle-ds.xml with the following settings.
<min-pool-size>10</min-pool-size>
<max-pool-size>50</max-pool-size>
<idle-timeout-minutes>10</idle-timeout-minutes>
I keep monitoring the Oracle sessions and find that the Idle sessions in the database stay INACTIVE for way over 10 minutes. Is there a check in JBoss that says "Only start checking if sessions are idle once they are above the MIN POOL size"? I don't understand how this works. Can someone please shed some light as to how I can troubleshoot this problem or better give me the solution to this problem?
Initially I found that the problem was that the tags for idle timeout were misformed and set to something ridiculously high like 500 minutes! But looking at the JMX MBean console proved that this parameter was set to 15 minutes! The database at the back showed idle sessions sitting for hours!
Any help would be appreciated.
Cheers,
MK
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4157977#4157977
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4157977
17 years, 10 months