Meaningless Drivel is fun!*
The moose likes Websphere and the fly likes Illegal use of 1PC datasource in Transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Illegal use of 1PC datasource in Transaction" Watch "Illegal use of 1PC datasource in Transaction" New topic
Author

Illegal use of 1PC datasource in Transaction

Keshav Deshpande
Greenhorn

Joined: Mar 24, 2002
Posts: 9
I am working on an app deployed on WAS 4.0.1 which uses CMP entity beans (for create and update DB operations) and DAOs (for DB read only operations). Both the DAOs and the CMP EJBs are front-ended by stateless session beans. I have created a datasource which is looked up from the global JNDI namespace and is used by both DAOs and the CMP entity beans.
My DAO's work correctly, but when I try to create a record using the create on my entity bean, I get the message, "ILLEGAL USE OF 1PC DATASOURCE IN TRANSACTION".
Interestingly, NO EXCEPTIONS are thrown whatsoever, but the record is NOT created in the database.
If anybody has come across this one or can shed any light on this, I would deeply appreciate it.
Balbir Singh
Ranch Hand

Joined: Jun 01, 2001
Posts: 79
Hi Keshav,
1PC means one phase commit. The exception you have mentioned occurs when you are trying to call 'prepare' on a one phase resource. We encountered the same problem, just modify the transaction attributes of your CMP's and it will work. I hope it helps.


Thanks and Regards<br />Balbir Singh<br />Sun Certified Java Programmer<br />IBM Certified Administrator for WebSphere4.0
Keshav Deshpande
Greenhorn

Joined: Mar 24, 2002
Posts: 9
Balbir:
Thanks for your reply. I am using the following attributes:
Session Bean - REQUIREDNEW
CMP Entity Beans - SUPPORTS
Just as an FYI, I found some information on the IBM WAS support web site. Here
Balbir Singh
Ranch Hand

Joined: Jun 01, 2001
Posts: 79
Hi Keshav,
Sorry for misleading you previously, I just checked out our problem log. We had encountered the same problem, we got it working by upgrading from WebSphere 4.0 to WebSphere 4.0.2.
Mike Jones
Ranch Hand

Joined: Dec 12, 2001
Posts: 109
Keshav,
Thanks for the link. I have a question about 4.0.1 fixes. If I just downloaded WebSphere 4.0.1, do I still need to apply fixes like this one dated 11/1/2001, or are fixes constantly being applied to the 4.0.1 download?
Thanks,
Mike


<BR>
Keshav Deshpande
Greenhorn

Joined: Mar 24, 2002
Posts: 9
All:
I just wanted to follow up on this issue. I applied the patch mentioned in the link to WAS 4.0.1 and that fixed the problem.
I will try out WAS 4.0.2, just for giggles and will keep you guys posted.
Thanks all, for your responses.
Keshav Deshpande
Keshav Deshpande
Greenhorn

Joined: Mar 24, 2002
Posts: 9
Mike:
AFAIK, you would still have to apply the patch, or as Balbir mentions, just go get WAS 4.0.2
Cheers
Keshav
Mike Jones
Ranch Hand

Joined: Dec 12, 2001
Posts: 109
I just tried to apply the 4.0.2 fixpack to 4.0.1, and it failed with a "unable to read input jar". I unzipped to a directory, and ran intall.bat. The was40_aes_ptf_2.jar is there. Any ideas?
Mike
Keshav Deshpande
Greenhorn

Joined: Mar 24, 2002
Posts: 9
Mike:
I followed the instructions in the readme file which came along with the patch download and it worked for me.
BTW, WAS 4.0.2 fixes the original problem.
Cheers,
Keshav
Mike Jones
Ranch Hand

Joined: Dec 12, 2001
Posts: 109
Keshav,
I finally got the 4.0.2 SP to install correctly. I needed to shut down the IBM HTTP Server. The WebSphere typical install had it start automatically at startup. Looks like alot of the DB2 services start up automatically also.
I'm looking for the WebSphere Application Server service and can't find it. Can you tell me what it's named. I'm on W2K and looking at Services in Administrative Tools in Control Panel.
Thanks for the help,
Mike
[ March 27, 2002: Message edited by: Mike Jones ]
Mike Jones
Ranch Hand

Joined: Dec 12, 2001
Posts: 109
I'm going to answer my own question. It show up in Processes under task manager as Java.exe.
Dave Hill
Greenhorn

Joined: Mar 21, 2003
Posts: 6
We are using WSAD Version: 5.0.1, Build id: 20030423_1316, and I am getting
Illegal use of 1PC resource in transaction when I change our datasource from SQL Server to IronEye (for tracing).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Illegal use of 1PC datasource in Transaction
 
Similar Threads
Illegal use of 1PC resource in transaction
Illegal use of 1PC resource in transaction
WSAD4 - Illegal use of 1PC resource in transaction
Illegal use of 1PC resource in transaction
Illegal use of 1PC resource in transaction