이 규칙은
weblogic.transaction.TransactionHelper getUserTransaction()
메소드를 사용하여 변경할 수 있습니다.
메소드 구현을 WebSphere Application Server에서 사용하도록 마이그레이션해야 합니다.
WebLogic 특정 getUserTransaction() 메소드 대신 다음 코드를 사용하십시오.
< span class="Code"> < span class= "JavaKeyword"> 공용 정적 < /span> < span class="JavaType">UserTransaction< /span> getUserTransaction () {
UserTransaction txn = null;
try {
Properties params = getInitialContextProperties();
javax.naming.InitialContext ctx = new javax.naming.InitialContext(params);
txn = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
} catch(Throwable t) {
t.printStackTrace();
}
return txn;
}
public static Properties getInitialContextProperties() {
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactoryName());
props.put(Context.URL_PKG_PREFIXES, "com.ibm.ws.runtime:com.ibm.ws.naming");
props.put("org.omg.CORBA.ORBClass", "com.ibm.CORBA.iiop.ORB");
return props;
}
자세한 정보는
네트워크 배치의 글로벌 트랜잭션을 참조하십시오.