-
1. Re: ReadOnly methods for entity beans
qjafcunuas Sep 26, 2002 6:19 AM (in response to annapurna)Hi
You should declare NotSupported transaction in your ejb-jar.xml like this :
<container-transaction>
<ejb-name>yourEJBName</ejb-name>
<method-name>yourMethod</method-name>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
Bruno -
2. Re: ReadOnly methods for entity beans
annapurna Sep 26, 2002 9:50 AM (in response to annapurna)Making the transaction not Supported ... doesnt this call the ejbStore but just do it outside a transaction?
Actually I was trying out with Required as the transaction attribute assuming I start my transaction in the session bean and continue it in my calls to the entity bean so that any number of gets I make do not raise ejbStore method.But this didnt happen.
Can anyone explain why? -
3. Re: ReadOnly methods for entity beans
qjafcunuas Sep 26, 2002 10:51 AM (in response to annapurna)Making the transaction not Supported ... does that you are in a read-only transaction.
I don't know if it's possible that ejbStore isn't call.
Nevertheless, you can define a boolean member variable to say if your data have been changed. So, in your ejbStore, you can evaluate your boolean to know if you have data to save. -
4. Re: ReadOnly methods for entity beans
hezekiel Sep 27, 2002 4:13 AM (in response to annapurna)NotSupported has nothing to do with ejbStore being called or not. It's a transaction attribute.
Just out of the curiosity I tried that out and it didn't do the trick. Even though my bulk accessor method (getData()) was marked with NotSupported transaction attribute - the call to that method caused ejbStore to be fired.
I think that the original question was that does JBoss support read-only methods (especially with BMP) like Web Logic and Resin do.
The answer is no. But I sure hope that it would be supported in the future! No more 'isModified'-hacks... -
5. Re: ReadOnly methods for entity beans
hezekiel Oct 3, 2002 5:16 AM (in response to annapurna)Oops...
Just found out (from the Jboss book 30_x.pdf)
Go buy it! - it's well worht the cost! =)
<enterprise-beans>
<ejb-name>nextgen.EnterpriseEntity</ejb-name>
<jndi-name>nextgen.EnterpriseEntity</jndi-name>
<method-attributes>
<method-name>get*</method-name>
<read-only>true</read-only>
<method-name>anotherReadOnlyMethod</method-name>
<read-only>true</read-only>
</method-attributes>
</enterprise-beans>