title: How to access datetime field outside of transaction with kotlin exposed
body: <p>I've got an exposed DAO-style setup with a <code>datetime</code>-column and want to access it after I received the row from the schema.</p>
  <p>Table:</p>
  <pre class="lang-kotlin prettyprint-override"><code>object Entries : IntIdTable() {
      val date = datetime(name = &quot;date&quot;).nullable()
  }
  </code></pre>
  <p>Entity:</p>
  <pre class="lang-kotlin prettyprint-override"><code>class Entry(id: EntityID&lt;Int&gt;) : IntEntity(id) {
      companion object : EntityClass&lt;Entry&gt;(Entries)
  
      var date by Entries.date
  }
  </code></pre>
  <p>DAO:</p>
  <pre class="lang-kotlin prettyprint-override"><code>object DB {
      private val pool = BasicDataSource()
      private val database: Database
  
      init {
          pool.url = &quot;jdbc:mysql://127.0.0.1:3306/test&quot;
          pool.driverClassName = &quot;com.mysql.cj.jdbc.Driver&quot;
          pool.username = &quot;user&quot;
          pool.password = &quot;secret&quot;
  
          pool.minIdle = 5
          pool.maxIdle = 10
  
          database = Database.connect(pool)
      }
  
      infix fun &lt;T&gt; query(block: DB.() -&gt; T): T {
          return transaction {
              block.invoke(this@DB)
          }
      }
  }
  </code></pre>
  <p>Main:</p>
  <pre class="lang-kotlin prettyprint-override"><code>fun main() {
    val entry = DB.query {
      Entry.all().single() // There is only one row at this point
    }
  
    println(entry.date) //! Error is thrown on this line
  }
  </code></pre>
  <p>It throws a <code>java.lang.IllegalStateException: No transaction in context.</code>. When I move the <code>println</code> into the transaction, it works as expected. If I change the type of the column to <code>varchar</code> and expect a <code>string</code> it works in both cases.</p>
  <p>How can I get the date outside of the transaction? I think it worked a few versions back, but I'm unsure.</p>