2 Replies Latest reply: Feb 14, 2011 11:20 AM by Jonathan Fields RSS

Deployment  question

Jonathan Fields Novice

Hi All,

 

I am considering using Mode Shape in an application that will require both a web app and a client app (e.g Eclipse RCP) to access the same repository. The repository itself will be a federation of JPA and File System connectors, and perhaps some other custom connectors in the future. The important point is that the repository will be accessing files locally on the server, so that the Mode Shape engine must run on the same server to access the local files.

 

I'll be using the JBoss deployment kit for Modeshape, and the web app will be a standard Seam app. That's straightforward. 

 

My question is how to best access the Mode Shape instance from the RCP client. At this point, I am thinking that I will develop application specific EJBs running in JBoss, that in turn invoke Mode Shape (and possibly other EE resources such as JPA EntityManager, other JCA connectors etc). The RCP client would invoke these EJBs remotely as a standard EJB client. Any feedback or suggestions on this approach or better alternatives?

 

Also, a related question. If Mode Shape is invoked from within an EJB with CMT, possibly along with other XA resources like JPA EntityManagers or other JCA connectors, does Mode Shape participate in the JTA transaction so that if the transaction is rolled back, Mode Shape rolls back as a part of the two phase commit?

 

 

Thanks!

  • 1. Deployment  question
    Randall Hauch Master

    My question is how to best access the Mode Shape instance from the RCP client. At this point, I am thinking that I will develop application specific EJBs running in JBoss, that in turn invoke Mode Shape (and possibly other EE resources such as JPA EntityManager, other JCA connectors etc). The RCP client would invoke these EJBs remotely as a standard EJB client. Any feedback or suggestions on this approach or better alternatives?

     

    You can do it with EJBs, or you can have the RCP client directly access the repository content through the RESTful service. If you're using Seam, it's probably easier for you and more conventional to write the business logic in EJBs, which have access to the full JCR API (since they're running in the same process as ModeShape). As you suggest, the RCP client would then be invoking these EJBs remotely, which is very conventional.

     

    Also, a related question. If Mode Shape is invoked from within an EJB with CMT, possibly along with other XA resources like JPA EntityManagers or other JCA connectors, does Mode Shape participate in the JTA transaction so that if the transaction is rolled back, Mode Shape rolls back as a part of the two phase commit?

    At this point, ModeShape cannot participate in JTA transactions, though we'd love to add support for this optional feature in JSR-283. While it'd be relatively straightforward when ModeShape uses a single JPA connector (or even multiple JPA connectors), it becomes much more challenging when ModeShape uses connectors to non-transactional sources like file systems.

  • 2. Deployment  question
    Jonathan Fields Novice

    Thank you for the quick answer, that was very helpful.