This has to be moved right after the shutdown of the transaction manager.
NOTE: I understand now why the transactionManager field is static