-
1. Re: update clients
dward2 Apr 22, 2002 2:25 PM (in response to ionel)As cool as JMS notification on entity change sounds, with even a medium-sized system and a handful of users the network would be chuck-full of messages flyin' around.
I don't have a good quick suggestion for you to automatically get changes made from another client, but as far as making sure you don't overwrite others' changes, try this:
Implement either a LAST_MODIFIED timestamp column or VERSION number column on their entity so that if you want to do an update, your slsb interface to your entity will first make sure your lastmod or version matches up, otherwise an exception is thrown indicating that someone else changed the entity since you last pulled data from it. The exception could also hold a value object with the newer data.
I'm fairly certain you can find some design pattern examples at theserverside.com for this.
Hope this helps,
David -
2. Re: update clients
jmschust Apr 22, 2002 3:36 PM (in response to ionel)This is not a bad solution just as long as the data doesn't change much. I'm using something similar for some somewhat-constant data. (changes about once per day, and I've put all my data within one entity bean instead of using the standard way of one bean per row). However, just like dward2 said, this puts lot's of overhead on the system.
The only other solution would to make your clients into servers also, and keep a reference to them. This in essance does exactly what JMS does, but with some limitation in overhead, if you have only a few clients. I would suggest however having one JMS client, internal to the server, 'notify' your other clients however, instead of just putting all the code into the ejbLoad and ejbStore.