EJB3 persistence doesn't care if the field is marked 'transient' or not. By default all properties are considered persistent...
use the javax.persistence.Transaction annotation on your properties/fields that you don't want mapped
I was hoping you would say that.
When we use access=AccessType.FIELD, the EntityManager does indeed ignore the transient Java keyword.
But when we use access=AccessType.PROPERTY, the EntityManager does not persist data members of the entity bean that are marked with the transient Java keyword. Sounds like a bug?
If AccessType.PROPERTY, then it finds/discovers the persistent props from setter/getter methods. If AccessType.FIELDS it finds/discovers by reflecting on the fields of the class.
So from the JBoss EJB3 container implementation perspective, would it make sense to rely on the behavior of the transient keyword or not?
Part of what makes me nervous of doing so is that the behavior of the JBoss EntityManager is different depending on whether the entity bean is using field or property based access type. Entity beans persisted with AccessType.PROPERTY, will not persist to the database if the underlying Java data member is a transient data member (Java transient keyword not the @Transient annotation).
The attractive part is that it is a very elegant solution, as long as it isn't an accidental side effect that may disappear in a future release of JBoss.
Would it be possible for the EJB3.0 specification to provide a statement clarifying the behavior?
The spec is clear, there is no mention of the transient keyword. We've considered this keyword as orthogonal to the ORM persistence.
If the implementation really behave this way, this is a bug: but I do not reproduce it. Check your code, there is probably an issue somewhere.