开发者

Historical Data and modified objects

开发者 https://www.devze.com 2023-01-28 10:40 出处:网络
My application receives object trees from a JMS topic, and must persist only those objects that have changed for historical purposes.

My application receives object trees from a JMS topic, and must persist only those objects that have changed for historical purposes.

If, for example, it receives an object tree with objects A, B, C (which already exist in the database according to their ids) in this hierarchical order (A contains B which contains C), but only object C has changed, only that object will be stored in the database, creating a new entry for historical purposes.

开发者_开发技巧

What solution is best for this approach? What technologies (Hibernate, JPA) can help me achieving this?


Here are two fundamentally different approaches to get you started.

  1. Insert the object tree temporary in a table in the database, and then run a stored procedure to do the historical analysis.

  2. Pull out the matching object tree from the database and then determine what to do in your code.

The typical depth of your tree, whether most jms objects result in a change, the rate at which you receive objects, the difficulty of how to detect a change, whether the same objects are sent repeated or not, are all things that will affect the best design choice.

After that, you should worry about what technology to go with.

0

精彩评论

暂无评论...
验证码 换一张
取 消