SessionFactory.concreteFactory must be initialized before Squeryl transactions can be invoked :
After the initialization of SessionFactory.concreteFactory, the transaction and inTransaction block functions (call by names) become available :
The ‘transaction’ function binds the session to the current thread for the duration of the block, so any method called directly and indirectly from the block will be in the context of the transaction.
When used within a framework that already manages transaction, for example a web framework, Squeryl must use the java.sql.Connection that belongs to the “current” context (usually implemented via thread local storage ) this can be accomplished by initializing SessionFactorye.externalTransactionManagementAdapter in the bootstrap code (before any Squeryl code gets to execute).
Given an org.squeryl.Session, Squeryl statements can be issued with the using function :