You should declare NotSupported transaction in your ejb-jar.xml like this :
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?
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.
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...
Just found out (from the Jboss book 30_x.pdf)
Go buy it! - it's well worht the cost! =)