Hi,
I am using EJB3/JPA for our application .. We have a table that has got 2 million rows..every few seconds we have to insert new records into it.Since there is no assurance that the record will not duplicate from the UI part,
we have a composite key for that too.
The problem :
************
Previous developers used to check for the existence of that particular record in the DB using the composite key and if present,they will print a message in the log.Else they will persist the record using persist() method.
Since i thought it involves two hits to the DB, thought of using merge (keeping in mind that this would work similar to Hibernte's saveOrUpdate)..it abruptly failed..
Do we have anything in EJB3+JPA to just like that save the record whether it is new or old..won't the JPA detect as Hibernate does ?
If that feature is not there in EJB, isn't it limiting the powers of Hibernate, sitting on top of it ?
Any help would be appreciated.
--Venuwin
|