I have one ejb bean method where in the catch section I am mentioning setRollbackOnly. Now if I throw a new custom exception from the method setRollbackOnly is getting executed.
Is there any way to get rid of that? Any help will be appreciated.
Are you throwing your new custom exception from within your try block? Transactions are not rolled back for custom exceptions unless you explicitly handle them (or unless your custom exception is a runtime exception). Could you post your code?