Need help on Mesh4x ( Mysql sync )

12 views
Skip to first unread message

Guywithgutsforever

unread,
Apr 28, 2009, 2:01:40 AM4/28/09
to Mesh4x Discussion
Hi .,

One of Online marriages consultant need Webapps which can use in their
centers.

they have 32 centers through out india.

we need to built application like synchronize data (MYSQL DB) at every
day mid night.

This process is introduced on the view of internet failures or other
scenario's.

we have data inputs @ all 32 centers and we have central DB server.

we need to sync every midnight @ 12.00 Am

Records are moving from server and to server also (Vice versa) -Two
way sync process

We need architecture for SYNC of MYSQL DB's of all 32 centers.

I think Mesh4X is suitable for this scenario right??

kindly tell me mesh4x java implementation for this.

jmt

unread,
Apr 29, 2009, 3:19:41 PM4/29/09
to Mesh4x Discussion
Hi,
Mesh4x is a framework and core libraries to support "2 way sync
process" based on FeedSync specification.
You have diferents adapters to syncronize diferents kind of data
sources (HibernateAdapter, HttpAdapter (for synchronize with
SyncServer), MsExcelAdapter, MSAccessAdapter, kmlAdapter, SMS, Mobile,
etc).

For MySQL tables we are using Hibernate with XML entities (no POJO
classes). You must use HibernateSyncAdapterFactory to build an
ISyncAdapter for MySQL (beta version, testing fase).

This is an example:

// create MySqlAdapter: DB=MyDB table=myTable
ISyncAdapter adapterA =
HibernateSyncAdapterFactory.createHibernateAdapter(
"jdbc:mysql:///MyDB",
"myUser",
"myPassword",
com.mysql.jdbc.Driver.class,
org.hibernate.dialect.MySQLDialect.class,
"myTable",
"myTable_sync",
"http://mesh4x/myTable#",
"c:\\MyMappingFolder\\");

// create MySqlAdapter: DB=MyDB2 table=myTable
ISyncAdapter adapterB =
HibernateSyncAdapterFactory.createHibernateAdapter(
"jdbc:mysql:///MyDB2",
"myUser2",
"myPassword2",
com.mysql.jdbc.Driver.class,
org.hibernate.dialect.MySQLDialect.class,
"myTable",
"myTable_sync",
"http://mesh4x/myTable#",
"c:\\MyMappingFolder2\\");

SyncEngine syncEngine = new SyncEngine(adapterA, adapterB); //
create a sync engine
List<Item> conflicts = syncEngine.synchronize(); // execute sync
algorithm

// Assert.assertEquals(0, conflicts.size());

Thanks,
JMT

Guywithgutsforever

unread,
Apr 30, 2009, 5:12:30 AM4/30/09
to Mesh4x Discussion
Hi JMT Thnx for ur info..

Let me ask few questions on it

1) where is HibernateSyncAdapterFactory class??

i need to build or any code available

2) we is my xml files??

3) we have table names <table> right ?? then y we need <table_sync>
table???

4) We got a list right for conflict..??what it's use??

5) this process will have capabilities like copy particular changed
column?

if u have any ready working environment ..then kindly
zip it send me to @ krishnara...@gmail.com

thnx in adavance.

Juan Marcelo Tondato

unread,
May 4, 2009, 9:08:52 AM5/4/09
to mes...@googlegroups.com
Hi, Guywithgutsforever
 
>>1) where is HibernateSyncAdapterFactory class??
Mesh4x is open source, all the code is available :)
Mesh4j project is the core library (in future versions we are thinking in split it).
See the following class org.mesh4j.sync.adapters.hibernate.HibernateSyncAdapterFactory
 
 
>>2) we is my xml files??
the idea is that the adapter create the mappings automatically for the table that you need to sync
 
>>3) we have table names <table> right ?? then y we need <table_sync>
table???
Yes. You need a sync table, if it does not exist Mesh4j create it automatically with the name that you are set.
 
>>4) We got a list right for conflict..??what it's use??
When the framework detects conflicts (based on FeedSync, go to mesh4x google code project for more details), it give you the list of conflicts items. The idea is that you take this list and decide which version is the winner.
See org.mesh4j.sync.merge.MergeBehavior.resolveConflicts()
 
>>5) this process will have capabilities like copy particular changed
column?
The framework supports add, update, delete and get db rows.
DB Schema changes will be supported in future versions.
 
 
>>if u have any ready working environment ..then kindly
 
Thanks in advance.
JMT
Reply all
Reply to author
Forward
0 new messages