Note that there are some explanatory texts on larger screens.

plurals
  1. POnew domain object created with grails console not visible in dbconsole
    primarykey
    data
    text
    <p>I am trying to create a new domain object in the grails console with the help of <a href="http://www.redtoad.ca/ataylor/2011/11/h2-database-console-in-grails-2/" rel="nofollow">this guide</a>. According to the console output the new object is created:</p> <pre><code>grails&gt; shell groovy:000&gt; new foo.Book(title: 'bar').save(failOnError: true, flush: true) groovy:000&gt; foo.Book : 1 groovy:000&gt; foo.Book.list() groovy:000&gt; [foo.Book : 1] </code></pre> <p>But this new book entity is not visible in the dbconsole The table BOOK is present when I connect with the JDBC url for the dev environment as found in DataSource.groovy:</p> <pre><code>jdbc:h2:mem:devDb;MVCC=TRUE username: sa password: &lt;blank&gt; </code></pre> <p>but a select returns 0 rows</p> <p>The relevant piece of DataSource.groovy config (the default)</p> <pre><code>dataSource { pooled = true driverClassName = "org.h2.Driver" username = "sa" password = "" } hibernate { cache.use_second_level_cache = true cache.use_query_cache = false cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3 // cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4 } // environment specific settings environments { development { dataSource { dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', '' url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000" } } </code></pre> <p>When the entity is created using the console, rather than the groovy shell, the issue remains.</p> <p>I am using the newest grails build at this moment, which is 2.3.1 <br /> The embedded H2 database vrsion = H2 1.3.173 (2013-07-28)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload