The @com.transaction directive specifies the transaction requirements for this Java/COM object when it is running within the Microsoft® Transaction Server (MTS). This attribute is equivalent to using @com.typeinfo({<GUID for required | requiresNew | supported | notSupported>}=0).
An @com.register directive must be specified if an @com.transaction directive is present.
The related GUIDs are shown in the following table.
17093CC5-9BD2-11CF-AA4F-304BF89C0001 | required |
17093CC6-9BD2-11CF-AA4F-304BF89C0001 | notSupported |
17093CC7-9BD2-11CF-AA4F-304BF89C0001 | requiresNew |
17093CC8-9BD2-11CF-AA4F-304BF89C0001 | supported |
@com.transaction(required | requiresNew | supported | notSupported)
required | Specifies that this Java/COM object requires a transaction when it is operating in MTS. If it is created within the scope of an existing transaction, the existing transaction is used. If there is no existing transaction, a new one is created.
Dependency: Cannot be used with requiresNew, notSupported, or supported. |
requiresNew | Specifies that this Java/COM object requires a new transaction to be created for it, regardless of whether one already exists.
Dependency: Cannot be used with required, notSupported, or supported. |
supported | Specifies that this Java/COM object will use a transaction if one has already been created, but that a new transaction should not be created if one does not already exist.
Dependency: Cannot be used with requiresNew, notSupported, or required. |
notSupported | Specifies that this Java/COM object does not support transactions.
Dependency: Cannot be used with requiresNew, required, or supported. |
COM_CustData | Class scope. |
A COM object is marked with the @com.transaction directive as follows:
/** @com.transaction(required) */ public class MyCOMObject { }
The equivalent specification with @com.typeinfo is
/** @com.typeinfo({17093CC5-9BD2-11CF-AA4F-304BF89C0001}=0) */ public class MyCOMObject { }