This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am currently working on the CRUD operation using JPA. While deleting an entity from the database, it is consuming a bit long time to complete the transaction. I have used entityManager.remove(entity) api. Since, the entity which I need to delete is having relation with other entities, all the references needs with those entities need to be deleted and hence it is taking so much of time. So is there any performance tricks can I implement to faster this deletion process?
The easiet way to achieve to deal is like you can have an cascade attribute defined where you establishing the relation. What cascade facilitates us when you have one to many relation ship between classes and the change made to the column need to be reflected among its dependencies is managed by cascade with ease. Cascade comes up with Cascade delete , save , update or delete orphan.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Help required on the entityManager remove() method