i have a customer ejb and customerrole ejb with a m:m relationship mapped across via a cross-over table so the idea is that people can only assign a role(s) to a customer that is in the customer role table , and then i have a session bean that managers the creation of users below
in the above code i want the entire transaction to be rollbacked so that the customer is removed and anything in the roles is removed in my transaction i have all methods set to required however everything runs and just throws an error when i try to insert a role that is not in the CustomerRole table please can any one help i've probably left loads of details out please let me know if it doesnt make sense
Originally posted by stephen smithstone: in the above code i want the entire transaction to be rollbacked so that the customer is removed and anything in the roles is removed in my transaction i have all methods set to required
Since the methods that createUser() calls [CustomerHome.crelate() and CustomerRole.add()] are transactional, I suspect that a transaction is being created for each method invokation. If you begin a transaction manually in createUser(), then you'll be able to roll it back entirely if creating the user or assigning roles fails.
posted 16 years ago
all sorted now i had the wrong table types in mySQL
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad: