In one of my requirement (Proxy to JDBC) i need to do the following.
1) the sender proxy has to insert large number (50K to 1 million) of records in to Database tables.
2) Before insertion it will check the LOCK/UNLOCK status of the tables. This status is in a separate single column table.
3) If UNLOCK then i want to make it LOCK and then delete the existing records from the table and then insert huge number of records.
4) then i want to again change the status to UNLOCK.
can you please guide the Best and efficient design approach.