Partioning with Hibernate

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-04-29T11:13:32Z Indexed on 2010/04/29 11:17 UTC
Read the original article Hit count: 245

Filed under:
|

Hello,

We have a requirement to delete data in the range of 200K from database everyday. Our application is Java/JEE based using Oracle DB and Hibernate ORM tool.

We explored various options like

  1. Hibernate batch processing
  2. Stored procedure
  3. Database partitioning

Our DBA suggests database partitioning is the best way to go, so we can easily recreate and drop the partitioned table everyday. Now the issue is we have 2 kinds of data, one which we want to delete everyday and the other which we want to keep it. Suppose this data is stored in table "Trade". Now with partitioning, we have 2 tables "Trade". We have already existing Hibernate based DAO layer to fetch/store trades from/to DB. When we decide to partition the database, how can we control the trades to go in which of the two tables through hibernate. Basically I want , the trades need to be deleted by end of the day, to go in partitioned table and the trades I want to keep, in main table. Please suggest how can this be possible with Hibernate. We may add an additional column to identify the trades to be deleted but how can we ensure these trades should go to partitioned trade table using hibernate.

I would appreciate if someone can suggest any better approach in case we are on wrong path.

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about database