Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I am getting pesimistlockexception when trying to persist multiple object of same time through JPA. Here is my code for reference
@Override @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) public Boolean changeDplListMappingByCustomWatchList(List<Integer> dplIds, Integer customWatchListId, ServiceRequestor customServiceRequestor) { for(Integer dplId : dplIds) { if(dplId != null) { CustomWatchListDplMapping customWatchListDplMapping = new CustomWatchListDplMapping(); customWatchListDplMapping.setDplId(dplId); customWatchListDplMapping.setWatchListId(customWatchListId); this.create(customWatchListDplMapping); } } } catch(Exception e) { LOG.error("Exception occured while changing dpl mapping by custom watchList id", e); } return true; } public void create(Model entity) { manager.persist(entity); manager.joinTransaction(); }
After first entity when it iterate through second one it throws an exception. If it has only one entity to save then it works well, but for more than one entity model it throws this exception.
by default pessimistic lock is for 1 second so please do the changes in the properties file it will help you to unlock and you will be able to save into database
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 9 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.