Hi Marten, thank you for your reply. Yes, is committing, I'm on mysql 5 with InnoDB tables, tryed with jboss 7 and tomcat 7, here's the log of tomcat:
Code:
16:20:36,246 DEBUG SessionImpl:253 - Opened session at timestamp: 13400292362
16:20:36,249 DEBUG AbstractTransactionImpl:158 - begin
16:20:36,250 DEBUG LogicalConnectionImpl:295 - Obtaining JDBC connection
16:20:36,259 DEBUG LogicalConnectionImpl:301 - Obtained JDBC connection
16:20:36,260 DEBUG JdbcTransaction:69 - initial autocommit status: true
16:20:36,260 DEBUG JdbcTransaction:71 - disabling autocommit
16:20:36,278 DEBUG ActionQueue:202 - Executing identity-insert immediately
16:20:36,307 DEBUG SQL:104 - insert into sample (sampleData1, sampleData2) values (?, ?)
Hibernate: insert into sample (sampleData1, sampleData2) values (?, ?)
16:20:36,342 DEBUG IdentifierGeneratorHelper:93 - Natively generated identity: 36
16:20:36,347 DEBUG AbstractTransactionImpl:173 - committing
16:20:36,348 DEBUG AbstractFlushingEventListener:143 - Processing flush-time cascades
16:20:36,349 DEBUG AbstractFlushingEventListener:183 - Dirty checking collections
16:20:36,352 DEBUG AbstractFlushingEventListener:117 - Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects
16:20:36,352 DEBUG AbstractFlushingEventListener:124 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
16:20:36,354 DEBUG EntityPrinter:114 - Listing entities:
16:20:36,355 DEBUG EntityPrinter:121 - com.domosafety.appname.models.SampleModel{sampleData2=data2ex, id=36, sampleData1=data1ex}
16:20:36,358 DEBUG JdbcTransaction:113 - committed JDBC Connection
16:20:36,359 DEBUG JdbcTransaction:126 - re-enabling autocommit
16:20:36,361 DEBUG LogicalConnectionImpl:314 - Releasing JDBC connection
16:20:36,361 DEBUG LogicalConnectionImpl:332 - Released JDBC connection
16:20:36,362 DEBUG ConnectionProxyHandler:219 - HHH000163: Logical connection releasing its physical connection
16:20:36,364 DEBUG SampleService:32 - Throwing exception...
18 juin 2012 16:20:36 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet [dispatcherServlet] in context with path [/spring-webapp-template] threw exception [Request processing failed; nested exception is java.lang.Exception: Error] with root cause
java.lang.Exception: Error
at com.domosafety.appname.services.impl.SampleServiceImpl.insertSampleDataWithErrors(SampleServiceImpl.java:33)
...
the last exception is the one I throw and from which I expect the rollback, it is in the service method now, same behavior when I use it in the controller method. Once the repository call ended the connection has been already committed and closed.
Any help is appreciated,
Thank you
Daniel