Open peter-plochan opened 4 years ago
I'm running into this issue as well. Even if you connect to a database, it will throw with a different-but-related error (java.lang.IllegalStateException: No transaction in context.
) if you try to call it outside of a transaction
block.
It looks like Column
itself overrides toString
and uses a fairly straightforward expression: "${table.javaClass.name}.$name"
. However, anything that wraps a Column
gets routed through Column
's toQueryBuilder
function, which uses TransactionManager
's fullIdentity
method.
Given that toString
is already contextual (can yield different results when called in different transaction
blocks, depending on the database they connect to), I see little downside in routing it to a default "generic SQL" IdentifierManagerApi
when called from outside a transaction
block with a specific known dialect.
Expression#toString method tries to transitively call TransactionManager with connected database which makes
toString
pretty unusable mainly for unit testing frameworks where the DB connection is not really needed. See e.g. this stacktrace: