-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 
Author Message
 Post subject: Transaction Manager for Sun ONE App Server 7
PostPosted: Thu Aug 28, 2003 3:45 pm 
Newbie

Joined: Thu Aug 28, 2003 3:33 pm
Posts: 3
Location: France
Hi,

I try to setup and use Hibernate with the Sun ONE Application Server 7.
There is no Hibernate Transaction Manager for Sun ONE Application Server 7.
Could you provide it ?

Thanks in advance.
Regards
Chris.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 3:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Sorry, you'll have to do some research and find out how to obtain the TM in Sun ONE. (I've no idea.)

Then we can add a SunONETransactionManagerLookup


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 4:15 pm 
Newbie

Joined: Thu Aug 28, 2003 3:33 pm
Posts: 3
Location: France
What info do you need from the Server7 to create the SunONETransactionManagerLookup ?
Chris.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 4:29 pm 
Newbie

Joined: Thu Aug 28, 2003 3:33 pm
Posts: 3
Location: France
The TransactionManager from the javax.transactionManager package is located in the sunONE Server 7's appserv-ext.jar file.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 4:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I need to know where the TM is at runtime. The J2EE spec gives me know way to do this portably. Most (but not all) appservers keep it in JNDI somewhere.

have a look in net.sf.hibernate.transaction.JBossTransactionManagerLookup, etc.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2003 7:49 am 
Newbie

Joined: Thu Nov 06, 2003 3:58 am
Posts: 2
Location: Sydney, Australia
Gavin,

Not sure if this was ever resolved. I'm also using Sun ONE App Server 7 and I've looked up the JNDI context as suggested. The values seem to be the same as the JBoss values and so I'd like to propose this:

Code:
package net.sf.hibernate.transaction;

/**
* TransactionManager lookup strategy for Sun ONE Application Server 7
* @author Robert Davidson
*/
public class SunONE7TransactionManagerLookup extends JNDITransactionManagerLookup {

   protected String getName() {
      return "java:/TransactionManager";
   }
   
   public String getUserTransactionName() {
      return "UserTransaction";
   }
}


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2003 7:54 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Looks good. Add it to JIRA.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 23, 2004 7:23 am 
Newbie

Joined: Wed Jan 07, 2004 12:02 pm
Posts: 15
Location: Herne, Germany
Robert,

I tried to look up the Sun ONE App Server 7 transaction manager the way you suggested, however I didn't succeed. I used your SunONE7TransactionManagerLookup implementation (only the package differs in my environment). Additionally I specified the following properties and added them to my hibernate configuration object. Moreover I set these properties as VM -D options.

properties.setProperty("hibernate.jndi.url", "iiop://<myhost>:3700");
properties.setProperty("hibernate.jndi.class", "com.sun.appserv.naming.S1ASCtxFactory");
properties.setProperty("hibernate.transaction.manager_lookup_class", SunOneTransactionManagerLookup.class.getName());
properties.setProperty("hibernate.transaction.factory_class", JTATransactionFactory.class.getName());

The app server reports the following to the console:

WARNING: CORE3283: stderr: Caused by: javax.naming.NameNotFoundException: No object bound to name java:/TransactionManager
WARNING: CORE3283: stderr: at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:796)
WARNING: CORE3283: stderr: at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:127)
WARNING: CORE3283: stderr: at javax.naming.InitialContext.lookup(InitialContext.java:347)
WARNING: CORE3283: stderr: at net.sf.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:23)
WARNING: CORE3283: stderr: ... 19 more

Any suggestions?

Thanks for help,

Roger


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 23, 2004 8:39 am 
Newbie

Joined: Thu Nov 06, 2003 3:58 am
Posts: 2
Location: Sydney, Australia
Roger,

I can see from you stack trace that what I suggested doesn't work. I didn't get those exceptions when I ran my application under SunONE with Hibernate but I think that it was because I didn't set up Hibernate correctly. I stopped using SunONE in favour of JBoss shortly after.

I feel bad that I wasted your time and did some searching around to see if I could find the answer for you but couldn't find anything. It may in fact not be possible to obtain the TransactionManager via JNDI with SunONE. It doesn't appear to be a requirement of the EJB spec and SunONE app server doesn't seem to do anything not absolutely required.

My apologies again for wasting your time.

Good luck with your development.

Robert


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 23, 2004 9:40 am 
Newbie

Joined: Wed Jan 07, 2004 12:02 pm
Posts: 15
Location: Herne, Germany
Robert,

thank you for your inquiries. After all it seems that you got the same results that we have here. Maybe somebody should open the issue in JIRA again?


Top
 Profile  
 
 Post subject: Sun ONE 7 integration, transaction manager lookup solution
PostPosted: Thu Feb 05, 2004 6:14 am 
Newbie

Joined: Wed Jan 07, 2004 12:02 pm
Posts: 15
Location: Herne, Germany
I described a new approach for the Sun ONE 7 integration:

http://forum.hibernate.org/viewtopic.php?t=927715

cheers,

Roger


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2004 8:13 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Can you post it to JIRA please and summarize why the previous approch fails ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 16, 2004 3:45 pm 
Beginner
Beginner

Joined: Thu Dec 11, 2003 11:59 am
Posts: 24
Btw, I finally got a SunOneTransactionManager that works:

http://forum.hibernate.org/viewtopic.php?t=927715


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.