We have a service class that goes like this
@Service
@Transactional
public class DoSomeServiceImpl1 implements IDoSomeService {
@Override
public void doSomething() throws SomeException {
//dao calls (database insert)
//ldap dao call (ldap insert)
}
When an exception happens in the ldap dao calls, the data inserted in the database remains there and does not rollback.
The ldap call method is something like the one below
public void insertLDAPRecord() throws SomeException {
try {
//ldap insert logic
} catch (LDAPException e) {
throw new SomeException("ldapexception",e);
}
}
Can anyone help me on this? Why wouldn't the database insert rollback? by the way for the dao call we are using spring-tx version 4.2.4.RELEASE and our app is running on Websphere 8.5