Well, actually the MBean or the Hibernate.jar file, it doesn't matter what you are using in JBoss AS. You still follow the exact same rules in Hibernate no matter the environment, in terms of your configuration and mapping files.
I would first say that having all the actual mapping of classes within your hibernate.cfg.xml is a maintenance nightmare, so to speak, they should always be seperated to make it much easier to handle. Or if you are using
Java 5.0 then use Annotations.
As far as code,
you should always open your Session, start a transaction, commit or rollback, then close your session. This is the "boilerplate" code that you should have everywhere. Then your whole actual Transaction implementation is completely hidden from your code, and it makes no difference whether you use JTA, Hibernate MBean, JBoss AS,
JDBC Transactions, your code always stays the same.
Mark