|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.servlet.session.UserTransactionWrapper
Section 6.6 of the J2EE specification lists of set of object types which a distributable application can placed in a javax.servlet.http.HttpSession object. It also indicates that these objects must be accurately recreated when they move from one VM to another as part of the HttpSession moving. One of these object types is javax.transaction.UserTransaction. However, there are no attributes retrievable from UserTransaction which either implement java.io.Serializable and can be used to reconstruct the UserTransaction. WebSphere offers 2 choices. First, you can simply place the UserTransaction in the HttpSession. While this will be allowed, the UserTransaction object will not be moved outside the VM (for example, to the database when persistent sessions are configured in WebSphere). Second, you can encapsulate the UserTransaction along with the javax.naming.InitialContext object that was used to obtain the transaction in the following wrapper object, UserTransactionWrapper. WebSphere will move the necessary elements of the InitialContext outside the VM, and then use those elements to reconstruct first the InitialContext and then the UserTransaction from the InitialContext. One should also note that per section 4.2.1 of J2EE, all transactions must be started and completed on the thread which the servlet/jsp sevice() method was invoked. This means all transactions are assumed complete (either committed rolled back) if and when a UserTransactionWrapper is transfered outside a VM.
Constructor Summary | |
---|---|
UserTransactionWrapper()
Deprecated. This is for Java Serialization purpose |
|
UserTransactionWrapper(javax.transaction.UserTransaction u,
javax.naming.InitialContext i)
Deprecated. Use this constructor to create UserTransactionWrapper object |
Method Summary | |
---|---|
javax.transaction.UserTransaction |
getUserTransaction()
Deprecated. |
void |
readExternal(java.io.ObjectInput in)
Deprecated. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
void |
writeExternal(java.io.ObjectOutput out)
Deprecated. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings and arrays. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UserTransactionWrapper(javax.transaction.UserTransaction u, javax.naming.InitialContext i)
public UserTransactionWrapper()
Method Detail |
public javax.transaction.UserTransaction getUserTransaction()
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.lang.ClassNotFoundException
- If the class for an object being
restored cannot be found.
java.io.IOException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
- Includes any I/O exceptions that may occur
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |