| Author |
Entity must be managed to call remove
|
ksh agarwal
Greenhorn
Joined: Dec 15, 2011
Posts: 22
|
|
Hi, I am facing a very common problem. I am not able to remove an entity from datatable. My entity class is:
My Dao class is:
My service class is:
And my spring-config xml file is:
What can be the reason behind this error:
Entity must be managed to call remove: com.infosys.ingreen.middleware.entity.ElectricDeviceEntity@908881, try merging the detached and try the remove again.
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3563
|
|
|
What you get as the deviceEntity in the method? Perhaps you can try some changes to the entity in the memory then call deleteDevice() method to see whether you get the entity from the DB after the call to merge()?
|
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
|
 |
ksh agarwal
Greenhorn
Joined: Dec 15, 2011
Posts: 22
|
|
Vijitha Kumara wrote:What you get as the deviceEntity in the method? Perhaps you can try some changes to the entity in the memory then call deleteDevice() method to see whether you get the entity from the DB after the call to merge()?
I have checked that...even what I have searched that entity in deleteDeviceDao class and then remove that found entity. But again the same error is coming. I dont know why the entity is not managed entity here?
|
 |
ksh agarwal
Greenhorn
Joined: Dec 15, 2011
Posts: 22
|
|
Vijitha Kumara wrote:What you get as the deviceEntity in the method? Perhaps you can try some changes to the entity in the memory then call deleteDevice() method to see whether you get the entity from the DB after the call to merge()?
When I tried the following change:
@Repository
@Component
The error comes is:
Exception Description: No transaction is currently active
Please help me....any suggestion??
|
 |
 |
|
|
subject: Entity must be managed to call remove
|
|
|