• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: linking editing contexts from two apps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linking editing contexts from two apps


  • Subject: Re: linking editing contexts from two apps
  • From: Ken Anderson <email@hidden>
  • Date: Wed, 05 Sep 2012 13:07:18 -0400


On Sep 5, 2012, at 12:50 PM, Chuck Hill <email@hidden> wrote:


I've used ERJGroupsSynchronizer with success and I'm very happy with it. But, what if the app that updates my database is not a WO application, but something done directly on the db? What's the common practice?

I don't know if there is a common practice, a lot depends on your exact situation.  You could poll the database for updates periodically.  Or manage object freshness so that you get updated objects when needed.

I have considered writing an article on this, and have commented before on similar things (probably 10 year ago).

I've built systems that use triggers to update tables that monitor what's happening on the database.  In general, I use 2 tables:

Transaction
TransactionTouch

plus, all objects in the database have a foreign key to the transaction table.

All participants in the DB, whether WO or not, have to create a new Transaction entity and attach the trans_id as a foreign key to each row added/updated.

Each table that needs to be monitored has insert/update/delete triggers that insert rows into the TransactionTouch table, which also has a foreign key to the transaction.

Now, you can have an app that periodically checks the Transaction table for new transactions.  Since you already know the highest number you scanned last, it's a simple short query (select * from transaction where OID > 1234).  NOTE: transaction is a reserved word in many databases.

For each transaction, you can check what records were "touched" by looking at the corresponding TransactionTouch records.  These typically just have the table name and primary key stored (enough for you to create the EOGlobalID).  You can then read in the record and recreate a snapshot if desired, and update the database context with the new snapshot.

Ken
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: linking editing contexts from two apps (From: Matteo Centro <email@hidden>)
 >Re: linking editing contexts from two apps (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Why are my EOs turning back to faults?
  • Next by Date: Re: Errors building Wonder with ant
  • Previous by thread: Re: linking editing contexts from two apps
  • Next by thread: Re: linking editing contexts from two apps
  • Index(es):
    • Date
    • Thread