hi, I been using hibernate for some time now, but I'm fairly new to it's tunning. I'm in the following situation: 1. I've a daemon that recieves UDP datagrams with information from multiple Devices (that is parsed into objects and analized) 2. I've a Web interface for configuring this objects (such as the parser that is used for that particular object).
Both softwares uses hibernate for ORM. Basically, when the daemon starts up it retrieves all the objects (Devices) from the DB, with it's associated configurations, and detach them form the session. Later, the daemon recieves the datagrams and add the parsed information to the corresponding Device Objects, and then save that information in the DB (saveOrUpdate, and detaching again). Then sleeps 30 ms, wakes up and start all over again (without the retrieving).
Any user can change the configuration of the Device from the Web interface. So what I need is one way of synching the object in the daemon with the changes made in the web interface, or at least making the daemon aware of the changes made.
To explain the situation more over, suppose I change the parser used by a Device Object in the web inteface, but the same Device Object (it's no the same object per se, the same representation in different JVM), that is detached, has the old parser associated. So, before the object is saved by the daemon (and the changes made by user reverted), I need to sync (or merge the changes), and then save the information recived from the datagram.
One consideration is that the Device Objects could be hundreds.
Hope I explain clearly enough the situation.
So, what do you recommend?
|