[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2939) Fujitsu Interstage TransactionManager Lookup Strategy

Hideki Hara (JIRA) noreply at atlassian.com
Wed Nov 14 05:23:29 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28826 ] 

Hideki Hara commented on HHH-2939:
----------------------------------

Dear Steve,

This is Hideki.

According to your suggestion, we are currently planning to officially register Fujitsu Interstage TransactionManagerLookup strategy for Fujitsu Interstage shown below into Hibernate organization somehow based on the result of discussion with our development team. I need a little more time to make dicision. I will get back to you very soon.


What I am trying to register is the following code.


----
package org.hibernate.transaction;

import java.util.Properties;

import javax.transaction.TransactionManager;
import javax.transaction.Transaction;
import javax.naming.InitialContext ;
import javax.naming.Context ;

import org.hibernate.HibernateException;

/**
 * TransactionManager lookup strategy for Fujitsu Interstage Application Server V9.0, which can be supported until V9.1 is released probably in April 2008.
 * @author Hideki Hara
 */

public class ISTransactionManagerLookup implements TransactionManagerLookup {

	/**
	 * @see org.hibernate.transaction.TransactionManagerLookup#getTransactionManager(Properties)
	 */

	public TransactionManager getTransactionManager(Properties props) throws HibernateException {

		try {
			return new ISTransactionManager();
		}

		catch (Exception e){
			throw new HibernateException( "Could not obtain Interstage transaction manager instance", e );
		}
	}

	/**
	 * @see org.hibernate.transaction.TransactionManagerLookup#getUserTransactionName()
	 */

	public String getUserTransactionName() {
		return "java:comp/UserTransaction";
	}



public class ISTransactionManager implements javax.transaction.TransactionManager {

	javax.transaction.UserTransaction tran = null ;

	public ISTransactionManager() throws javax.naming.NamingException {
		javax.naming.InitialContext context = new javax.naming.InitialContext() ;
		tran = (javax.transaction.UserTransaction)context.lookup("java:comp/UserTransaction");
	}


	public void begin() throws javax.transaction.NotSupportedException,javax.transaction.SystemException{
		tran.begin() ;
	}


	public void commit() throws javax.transaction.RollbackException,
                   javax.transaction.HeuristicMixedException,
                   javax.transaction.HeuristicRollbackException,
                   java.lang.SecurityException,
                   java.lang.IllegalStateException,
                   javax.transaction.SystemException {
		tran.commit() ;
	}


	public int getStatus() throws javax.transaction.SystemException{
		return tran.getStatus() ;
	}

	public javax.transaction.Transaction getTransaction() {
		throw new java.lang.UnsupportedOperationException() ;
	}


	public void resume(Transaction tobj) {
		throw new java.lang.UnsupportedOperationException() ;
	}


	public void rollback() throws javax.transaction.SystemException{
		tran.rollback() ;
	}


	public void setRollbackOnly() throws javax.transaction.SystemException{
		tran.setRollbackOnly() ;
	}


	public void setTransactionTimeout(int seconds) throws javax.transaction.SystemException{
		tran.setTransactionTimeout(seconds) ;
	}


	public javax.transaction.Transaction suspend() {
		throw new java.lang.UnsupportedOperationException() ;
	}

   }

}
----

Thank you so much indeed for your cooperation on this matter.
Best regards,
Hideki Hara


> Fujitsu Interstage TransactionManager Lookup Strategy
> -----------------------------------------------------
>
>                 Key: HHH-2939
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2939
>             Project: Hibernate3
>          Issue Type: New Feature
>          Components: core
>    Affects Versions: 3.2.0.ga
>         Environment: Hibernate 3 or later, Oracle 9i/10g(RDB), Fujitsu Interstage (Application Server), Windows XP/2003 (OS)
>            Reporter: Hideki Hara
>            Priority: Minor
>         Attachments: hiberweb2.zip
>
>   Original Estimate: 5 days
>  Remaining Estimate: 5 days
>
> Dear Steve,
>   My name is Hideki Hara, I work for Fujitsu.
>   Fujitsu is one of IT company which provides application server software product based on J2EE spec.
>   This is a request about TransactionManagerLookup strategy for Fujitsu Interstage product.
>   I have made "org.hibernate.transaction.ISTransactionManager" class which implements "org.hibernate.transaction.TransactionManagerLookup" for Fujitsu Interstage.
>   It's now working well here in our environment according to my test.
>   Therefore is could you please register this into Hibernate organization somehow officially, if you don't mind?
> ----------------
> package org.hibernate.transaction;
> import java.util.Properties;
> import javax.transaction.TransactionManager;
> import org.hibernate.HibernateException;
> /**
>  * TransactionManager lookup strategy for Fujitsu Interstage
>  * @author Hideki Hara
>  */
> public class ISTransactionManagerLookup implements TransactionManagerLookup {
> 	/**
> 	 * @see org.hibernate.transaction.TransactionManagerLookup#getTransactionManager(Properties)
> 	 */
> 	public TransactionManager getTransactionManager(Properties props) throws HibernateException {
> 		try {
> 			Class clazz = Class.forName("com.fujitsu.interstage.transaction.ISTransactionManager");
> 			return (javax.transaction.TransactionManager)clazz.newInstance();
> 		}
> 		catch (Exception e){
> 			throw new HibernateException( "Could not obtain Interstage transaction manager instance", e );
> 		}
> 	}
> 	/**
> 	 * @see org.hibernate.transaction.TransactionManagerLookup#getUserTransactionName()
> 	 */
> 	public String getUserTransactionName() {
> 		return "java:comp/UserTransaction";
> 	}
> }
> ----------------------------
>   For your information, I attached a sample J2EE application with Fujitsu Interstage TransactionManagerLookup Strategy.
>   Please see attached.
>   This is for your information.
>   - Prerequisite:
>     - This is a simple Servlet (J2EE) application
>     - it is using Hibernate 3 on Fujitsu Interstage.
>     - I have removed all the JAR files under WEB-INF/lib directory considering file size.
>     - Data base is Oracle 9i/10g.
>     - JDBC Data Source name is "aaa".
>     -  RDB Table name is "aaa" as well.
>     -  column 1: column name "no", data type "number" nullable no, primary key
>     -  column 2: column name "name",  data type varchar2(256), nullable yes
>   - How to get started.
>     - Please extract the attached file.
>     - Put every single required JAR file into under WEB-INF/lib direcoty.
>        - antlr-2.7.6.jar
>        - ojdbc14.jar
>        - commons-collections-2.1.1.jar
>        - commons-logging-1.0.4.jar
>        - dom4j-1.6.1.jar
>        - hibernate3.jar
>        - jta.jar
>     - archive it with JAR command to make sample.war file.
>     - Deploy it into your any Workunit on Interstage.
>     - Access to http://localhost/sample/index.html.
>     - Click "submit".
>   - How it works.
>     - Fujitsu Interstage provides "com.fujitsu.interstage.transaction.ISTransactionManager" to create a new instance of TransactionManager.
>     - Fujitsu Interstage provides "org.hibernate.transaction.ISTransactionManagerLookup" for Fujitsu Interstage TM Lookup strategy, instead of Hibernate organization. Note that I am currently asking Hibernate organization to officially register this into your site. I want to know what to do to move forward.
>     - Specify "org.hibernate.transaction.ISTransactionManagerLookup" in "hibernate.transaction.manager_lookup_class" property in either hibernate.cfg.xml or hibernate.properties file.
>   It would be very much appreciated if you tell me what I should do to officially register this to your site. I will follow an appropreate procedure based on your requirement.
>   I will be waiting for your reply.
>   Thank you so much indeed in advance for your cooperation.
>   Best regards,
>   Hideki Hara
>   Sorry for inconvenience, I don't want to disturb you, but I need your help and assistance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list