I'm facing a situation I can't even find a way to debug.
I have the following spring-data repositories:
IntegrationLogRepository
public interface IntegrationLogRepository extends PagingAndSortingRepository<IntegrationLog, Long> {
}
FooRepository
public interface FooRepository extends PagingAndSortingRepository<Foo, Long> {
}
And on my business logic I have something like the following:
IntegrationLog log = new IntegrationLog();
log.setTimestamp(new Date());
try {
Foo foo = new Foo();
// Build the Foo object...
fooRepository.save(foo);
log.setStatus("OK");
} catch (Exception e) {
log.setStatus("NOK");
} finally {
integrationLogRepository.save(log);
}
When the integrations runs fine, the log is saved with the OK status. Everything is fine. But when I have an exception, for some reason integrationLogRepository.save(log) doesn't do nothing. I mean nothing NOTHING: No exception is thrown and I can't see any hibernate query being executed on my WebLogic console. The log is not persisted...
Any ideas on why this is happening?
Following are my dependencies:
compile 'org.springframework.boot:spring-boot-starter-data-rest'
compile 'org.springframework.boot:spring-boot-starter-security'
compile "org.springframework.boot:spring-boot-starter-web-services"
runtime 'org.springframework.boot:spring-boot-devtools'
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
compile "org.springframework.boot:spring-boot-starter-websocket"
compile 'javax.servlet:javax.servlet-api:3.1.0'
compile 'org.hibernate:hibernate-core:5.1.16.Final'
compile 'org.hibernate:hibernate-validator:5.2.3.Final'
compile 'org.hibernate:hibernate-entitymanager:5.1.0.Final'
Running on Spring Boot 1.5.15.RELEASE, Java 1.7 and WebLogic 12.1.3.
Thanks!