Details :
For [CabinEJB]
Error: Transaction attributes must be specified for the methods defined in the home interface [com.daines.titan.cabin.CabinHome]. Method [create] has no transaction attribute defined within this bean [CabinEJB].
?!?!?!?
[QB]
Now, my interpretation of this is that I've not implemented a create() method. In my xxxHome interface, I have the create() method, and in xxxBean I have a corresponding ejbCreate() method with the same parameters.
No i dont think the error means that. Infact the error means exactly what it reports.
Details :
For [CabinEJB]
Error: Transaction attributes must be specified for the methods defined in the home interface [com.daines.titan.cabin.CabinHome]. Method [create] has no transaction attribute defined within this bean [CabinEJB].
For a CMP entity bean, you must define a transaction attribute for
1. Methods in the remote interface ( i mean all the business methods like setDeckLevel() etc)
2. create() and find<METHOD> in the home interface
that you w'd have defined.
3. remove() in EJBHome and EJBObject.
Let me not talk about new ejbHome methods now.
From your descriptor it is clear that you have defined the attributes for case 1) ie all business methods in the remote interface.
But 2) & 3) are still left!
Why dont use the wildcard "*" to specify a transaction attribute for all the methods.
You can then override the attribute for some specific methods if you chose to.
You can just have :
<container-transaction>
<method>
<ejb-name>CabinEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</transaction-attribute>
</container-transaction>
This associates a transaction attribute of "required" with all the methods.
In case you want to specify a different transaction attribute for any of the methods , you can override it later ( the way you have done it in the descriptor). ie you can have
<container-transaction>
<method>
<ejb-name>CabinEJB</ejb-name>
<method-name>getCabinName</method-name>
</method>
<trans-attribute>NotSupported</transaction-attribute>
</container-transaction>
which means that getCabinName does not support or execute in a transaction ( even if the calling code has some transaction associated with it).
while others run under "Required" attribute.
The fastest and most reliable components of any system are those that are not there. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|