Java Persistence API for JCA Connections?

Hi all. I'm looking into development efforts for writing some Web Application front-ends. As part of this, I'd like to develop some JCA Adapter components into our system. I'd like to do this in order to standardize transactional control for our data in an enterprise environment. We should be able to do this without much drama.

For the web application, I'd like to have a data model which will be used to read data from (and write data to) our system (via the JCA component). I've been looking at the Java Persistence API, and it looks very good. All the examples I've seen, however, define entity classes against specific database tables. Given that it was originally defined to encapsulate database records as Java objects, I can understand that.

However, would it be possible to use the Java Persistence API against JCA Adapter components? I'm guessing you would need to plug something into the EntityManager itself and use different annotations. For example, would defining a jta-datasource be applicable if I weren't going to use a JDBC Connection Pool?

My gut reaction, based on the available doco I can glean, is that I can't do this. But I thought I'd ask the question in case someone more knowledgeable in this area can tell me I'm wrong. :)

Thanks for any help,

Ed

[1324 byte] By [EdHildoa] at [2007-11-26 18:22:55]
# 1

I've been doing some digging, and this looks promising. In the persistence.xml, a Persistence Provider is defined for the Persistence Unit. It appears that this is a class that implements the interface javax.persistence.spi.PersistenceProvider. From this base, the Provider returns EntityManagerFactory and EntityManager implementations. And this is the entity manager that is provided to the various components using JPA.

So, if we provided an EntityManager that implemented the interfaces to use against our JCA Connection, we should be able to do this, yes? Does anyone know if I'm on the right direction?

If so, would anyone know of any doco which talks about doing this? It looks like it would be a bit of work, but essentially doable.

Again, thanks for any help that you can provide.

Ed

EdHildoa at 2007-7-9 5:56:50 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...