-
1. Re: Transaction enlist error
adrian.brock Jul 9, 2004 10:51 PM (in response to ms26368)The message says you are trying to reuse a connection in two different transactions.
Most likely because you are breaking the pooling, e.g. holding the connection in a
static field. -
2. Re: Transaction enlist error
ms26368 Jul 12, 2004 10:39 AM (in response to ms26368)i have session bean which is container managed transaction. this session bean calls the entity beans method and another method which executes sql statements. now the method which executes sql statement open another database connection.
here is the method of session bean
getcontract()
{
entity.findByPrimaryKey --- opens database connection
getDevice() --- opens another database connection
}
here is the question i have
1) can i change the session bean to bean managed transaction?
2) what the default transaction attribute for container managed transaction?
3) is there any quick fix for this kind of problem with this kind of coding pattern?
Thanks for your reply -
3. Re: Transaction enlist error
adrian.brock Jul 14, 2004 12:19 AM (in response to ms26368)Your code shows no pooling.
Specifc Answers:
1) Yes
2) Required
3) You don't show your database access pattern. -
4. Re: Transaction enlist error
ms26368 Jul 14, 2004 4:02 PM (in response to ms26368)I have resolved this issue. the issue was container configured with no entity bean locking so, two thread tries to access the same entity bean causing this error