javajunky
06-02-2007, 09:43 AM
Hi,
This question relates to post (http://forum.springframework.net/showpost.php?p=7332&postcount=9 ) but I'm posting in here as I don't *think* its a spring NHibernate issue any more (I did previously). I think it is either something stupid I'm doing, or a Spring.Data... issue
I've got a singleton DAO, and singleton Service to which the DAO is injected. until recently all my service methods were marked as PROPAGATION_REQUIRED, but I've just had the need to mark one of my methods as PROPAGATION_REQUIRES_NEW (to avoid some nasty table locking issues around a web-service call), *however* since I've made this change my application has become very unstable, and I repeatedly see the exception displayed in the post referred to above.
I've now isolated it (I think) so that it only occurs when there is a concurrent access to the Service/DAO tier at the same time as the transaction that is meant to be being closed off (as per PROPAGATION_REQUIRES_NEW).
Should what I'm trying to do, be legal, is anyone else using REQUIRES_NEW in a heavily multi-threaded environment (my app tier is a web-service tier, which can also call out to other web-service tiers, sometimes back into itself!)
Many thanks, I really hope this isn't considered a cross-post, because I don't believe it to be, as this post reflects a greater understanding of the issue on my part!
- Sorry
This question relates to post (http://forum.springframework.net/showpost.php?p=7332&postcount=9 ) but I'm posting in here as I don't *think* its a spring NHibernate issue any more (I did previously). I think it is either something stupid I'm doing, or a Spring.Data... issue
I've got a singleton DAO, and singleton Service to which the DAO is injected. until recently all my service methods were marked as PROPAGATION_REQUIRED, but I've just had the need to mark one of my methods as PROPAGATION_REQUIRES_NEW (to avoid some nasty table locking issues around a web-service call), *however* since I've made this change my application has become very unstable, and I repeatedly see the exception displayed in the post referred to above.
I've now isolated it (I think) so that it only occurs when there is a concurrent access to the Service/DAO tier at the same time as the transaction that is meant to be being closed off (as per PROPAGATION_REQUIRES_NEW).
Should what I'm trying to do, be legal, is anyone else using REQUIRES_NEW in a heavily multi-threaded environment (my app tier is a web-service tier, which can also call out to other web-service tiers, sometimes back into itself!)
Many thanks, I really hope this isn't considered a cross-post, because I don't believe it to be, as this post reflects a greater understanding of the issue on my part!
- Sorry