AnsweredAssumed Answered

Two J2EE application on same repository !!

Question asked by alex54 on Jan 11, 2010
Latest reply on Jan 11, 2010 by alex54
Hello,

I develop an J2EE application. This application has its own business.

This application can call Alfresco Repository (use of all needed repository services access via JARs).

All is well configured (custom XML files (db connection links and type, specification of the 'alf_data' folder, etc…), custom Model, etc..).

I use Alfresco in a Tomcat, in order to have like an 'administrative' application (to manage space, contents, etc… as an administrative way). The Alfresco native Web interface is perfect for this ;)

In my stand-alone 3-tiers application, I developped some personal services (my own business).
Theses services call sometimes Alfresco services (SearchService, NodeService,etc…): These Alfresco services are injected by my Spring during the start of my Tomcat server.

When I start servers, all is fine:
==> Alfresco is runnig on the localhost:8080/alfresco
==> My Application is runing on the localhost:8082/myApplication ( Alfresco context is also loaded via Spring, and Alfresco services are found and well injected into my own services.)
==> Both application are running in the same time: No problem with that. The both application are link to the same 'alf_data' folder , and use the same database  ;)
All works fine: I can call my services, and get GOOD result from Alfresco respository…  :)

BUT I HAVE A PROBLEM CONCERNING DATA RENDER BY ALFRESCO SERVICES (in my application I mean) WHEN A CONTENT IS CHANGED IN ALFRESCO APPLICATION WEB INTERFACE ! (and Vice-versa !)

Example of Test process:
- MyApplication (on localhost:8082/myApplication): I Call myCustomSearchService => this call Alfresco SearchService, in order to get one content named "myFile.txt" in a special Space: I get the node (OK)   :D
- Alfresco Web interface (on localhost:8080/alfresco): I modify the name of "myFile.txt" into "myNewFile.txt" (OK) :D
- MyApplication: I RECall myCustomSearchService => this call Alfresco SearchService, in order to get one content named "myFile.txt" in a special Space (THIS MUST RETURN NULL because the file don't exist anymore: the name was changed), But I get the node !! ==> This is NOT OK !! :|   (Because this content/node don't exist anymore !!)

The only solution to get the goo result is to restart Tomcat (localhost:8082) where MyApplication is deployed.  :oops:
In this case only, changed are noticed, and the searchService (or nodeService) return good result …

MyApplication and Alfresco seems to live their own live (transaction problem ?? caching problem (LR2)??)

This is strange, because in myApplication, like in Alfresco application, both are accessing to the same database, and the same content alf_data (same indexes)

I hope that you are able to help me
Thanks a lot in advance.   :)

Note: I don't want use Alfresco Web services (personnals reasons ;) )

——————————————
Alfresco version
- Version of Alfresco: 3.1.0
- Operating System: Windows
- Database: MySQL
- Web Application Server: Tomcat
- Browser version: IE or Firefox

Outcomes