OK... after searching the web for a while I found a snippit about sync-on-commit-only. By flipping this value to true (<sync-on-commit-only>true</sync-on-commit-only>), the deletes are happening without the update and everything seems to be working great. I don't know the impact of this change, however. I own the JBoss documentation and I can't find anything in there about it. The description in the DTD seems a little vague... Does anyone know if I am shooting myself in the foot with this change?
Thanks for your help,
When i browsed the web. I got the following information.
"Use <sync-on-commit-only>true</sync-on-commit-only>: What this switch does is to only do SQL UPDATEs at commit time. By default, JBoss will do updates of any dirty entities whenever a finder is called. With sync-on-commit-only set to true, however, this synchronization will still happen when deletes/removes are done to ensure that cascade deletes work correctly."
But when i changed this flag to "true", i got some exceptions like "cannot remove PK" like that. So i had to change it back to the default value "false".
Thanks for the info mkyaj. Do you (or any other reader) have any ideas as to what the downside of only doing the updates at commit time? Will it slow things down or be less optimal? Is it dangerous from a data integrity standpoint?
Definitely it wont slow down things as we are reduding the number of database transactions. If it works as per the documentation, then i think there shouldn't be any problems as we are not committing while calling finder methods(reading the data).
I too want to know more about this option.