I never said Hibernate was a resource. I know it only uses the connection it obtains from the datasource to communicate with the database, but this connection needs to be enlisted with a Transaction Manager for distributed transactions, right?
Hibernate does something similar to this I assume:
Code:
/* Hibernate gets connection from datasource */
XADataSource ds = context.lookup("derbyds");
XAConnection con = ds.getXAConnection();
/* The XAResource needed by JOTM can be retrieved this way now */
XAResource res = con.getXAResource();
So Hibernate is not a resource, but it uses an XAConnection where you can get an XAResource, which is the type of resource that needs to be registered with a Transaction Manager for distributed transactions. (Or transactions involving more than one database)
To me it seems that Hibernate does not do this...