Link

Integration relational DB with Jalios

David Van Baelen - on 3/21/06 at 4:17 PM

Is it possible to synchronise objects inside jalios with some records from a relational DB ? Is there already a connector (for which databases) or do we have to develop everything by our own.

Olivier Dedieu - on 3/21/06 at 5:32 PM

JCMS does not provide such a connector.

Since JCMS 5.5, you can, without any developpment, display DB record when displaying a JCMS content. For more details, check out JCMS 5.5 : Les principales nouveautés (in french). This works with JCBC compliant RDBMS such as MySQL, SQLQuery and Oracle.

To export JCMS objects to a RBDMS, you have to develop a custom DataController. A DataController (see the article JCMS 5 : Développer avec DCM et les DataController ) is a Java component which can intercept any data write and perform custom actions (such as writing in a RDBMS). Then the DB can be updated either with JDBC query or with O/R mapping framework such as Hibernate.

DataController or StoreListener ?

Sylvain DEVAUX - on 6/30/06 at 3:05 PM

Hello, (i keep on in English for David)

I made a connection with an Oracle DB (JDBC) to get data when I create a new Publication in JCMS. For now, I am using a storeListener on my class, and would like to know if DataController is better ? I just want to retrieve informations in the DB related to the title I enter when creating my new object. As I understood, DataController is a little more complicated, ans is usefull for specific actions, like action depending on the Pstatus, etc..

Can someone exlpain me the difference between StoreListener and DataController ?

Thanx

Re: DataController or StoreListener ?

Olivier Dedieu - on 6/30/06 at 7:21 PM

If you get data from a DB to fill a publication when it is created, you should use a DataController.

The main difference is about when and where the DataController/StoreListener is called :

  • A DataController is called before and after any write operation on the replica it occurs. Furthermore, a DataController can check the data integrity and validity.
  • A StoreListener is called after a write operation has been processed. There are 3 possible cases:
    1. after the write operation occurs ;
    2. when the store is loaded ;
    3. when this operations is received on a replica (through JSync protocol).

Some practical differences :

  1. A DataController can prevent or modify a write ; a StoreListener cannot.
  2. A StoreListener can be called at JCMS start-up (when the store is loaded) ; A DataController is only called at the very first time the write operation occurs.
  3. A StoreListener can be called on any replica ; a DataController is only called on the replica which has performed the action.

Which one to use?

  • DataController :
    1. To check data integrity ;
    2. To check if a write operation is valid ;
    3. To modify the content of an object before the write operation ;
    4. To trigger an action before or after a write operation if this action must be triggered only once.
  • StoreListener:
    1. To manage data index ;
    2. To trigger an action for each replica ;
    3. To trigger an action each time the store is loaded.
Login   Home   fr en
JALIOS SA - SIREN 440 126 035