Monday, September 21, 2020

Preparing Pivotal Spring Certification

I have bought "Core Spring 5 Certification in Detail" By: Ivan Krizsan on Kobo, only 5 USD and it's quite good. 

Previously I have tried the book by Iuliana Cosmina, but it's too verbose for my taste, I get lost in words, I like only very succinct statement with code samples where needed. Especially I hate "sample applications" developed for the sake of demonstrating the framework... normally they turn into overcomplicated examples where the same patterns are applied "ad nauseam".





Sunday, September 20, 2020

Viewing Spring transaction information

enable these flags: 

logging.level.org.springframework.orm.jpa=TRACE

logging.level.org.springframework.transaction=TRACE

 

 and you will see this in the logs: 

 

2020-09-20 18:40:00.788 DEBUG 4904 --- [ restartedMain] o.s.orm.jpa.JpaTransactionManager : Opened new EntityManager [SessionImpl(239595802<open>)] for JPA transaction 

2020-09-20 18:40:00.794 DEBUG 4904 --- [ restartedMain] o.s.orm.jpa.JpaTransactionManager : Exposing JPA transaction as JDBC [org.springframework.orm.jpa.vendor.HibernateJpaDialect$HibernateConnectionHandle@12096038] 

2020-09-20 18:40:00.805 DEBUG 4904 --- [ restartedMain] o.s.orm.jpa.JpaTransactionManager : Found thread-bound EntityManager [SessionImpl(239595802<open>)] for JPA transaction 

2020-09-20 18:40:00.805 DEBUG 4904 --- [ restartedMain] o.s.orm.jpa.JpaTransactionManager : Participating in existing transaction 

2020-09-20 18:40:00.834 DEBUG 4904 --- [ restartedMain] o.s.orm.jpa.JpaTransactionManager : Initiating transaction commit 2020-09-20 18:40:00.839 DEBUG 4904 --- [ restartedMain] o.s.orm.jpa.JpaTransactionManager : Committing JPA transaction on EntityManager [SessionImpl(239595802<open>)] 

2020-09-20 18:40:00.856 DEBUG 4904 --- [ restartedMain] o.s.orm.jpa.JpaTransactionManager : Closing JPA EntityManager [SessionImpl(239595802<open>)] after transaction 

 plus a lot of TRACE information equally useful (omitted here)

Demo code is available here https://github.com/vernetto/txdemo