Hibernate 5.0.2 with Sqlite -- cannot get it working due to errors
<p>While investigating Hibernate / JPA / ORM I found a HibernateHelloWorld Java application from the net. </p>

<p>Via Maven I use these libs: </p>

<pre><code>   &lt;dependency&gt;
        &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
        &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
        &lt;version&gt;5.0.2.Final&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.xerial&lt;/groupId&gt;
        &lt;artifactId&gt;sqlite-jdbc&lt;/artifactId&gt;
        &lt;version&gt;3.15.0&lt;/version&gt;
    &lt;/dependency&gt;
</code></pre>

<p>[1] When running the app, my first issue was that no table could be created. OK, I created the table. </p>

<p>[2] Second issue was that the commit could not be done. </p>

<p>[3] Third issue is that the database keeps on being locked. </p>

<p>The hibernate config file is: </p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" 
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;

&lt;hibernate-configuration&gt;
    &lt;session-factory&gt;
        &lt;property name="show_sql"&gt;true&lt;/property&gt;
        &lt;property name="format_sql"&gt;true&lt;/property&gt;
        &lt;property name="dialect"&gt;org.hibernate.dialect.SQLiteDialect&lt;/property&gt;
        &lt;property name="connection.driver_class"&gt;org.sqlite.JDBC&lt;/property&gt;
        &lt;property name="connection.url"&gt;jdbc:sqlite:mydb.db&lt;/property&gt;
        &lt;property name="connection.username"&gt;&lt;/property&gt;
        &lt;property name="connection.password"&gt;&lt;/property&gt;
        &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;
        &lt;mapping class="nl.deholtmans.HibernateHelloWorld.Contact"/&gt;
    &lt;/session-factory&gt;
&lt;/hibernate-configuration&gt;
</code></pre>

<p>The POJO with annotations is: </p>

<pre><code>@Entity
@Table(name = "contact")
public class Contact {
    private Integer id;
    private String name;
    private String email;

    public Contact() {

    }

    public Contact(Integer id, String name, String email) {
        this.id = id;
        this.name = name;
        this.email = email;
    }

    @Id
    public Integer getId() {
        return this.id;
    }
    // etc. 
</code></pre>

<p>The simple HibernateHelloWorld app is this: </p>

<pre><code>public class App {
    private static SessionFactory sessionFactory = null;  
    private static SessionFactory configureSessionFactory() throws HibernateException {  
        sessionFactory = new Configuration()
            .configure() 
            .buildSessionFactory();
        return sessionFactory;
    }

    public static void main(String[] args) {
        configureSessionFactory();
        Session session = null;
        Transaction tx=null;
        try {
            session = sessionFactory.openSession();
            tx = session.beginTransaction();

            Contact myContact = new Contact(202, "My Name", "my_email@email.com");
            Contact yourContact = new Contact(203, "Your Name", "your_email@email.com");

            session.save(myContact);
            session.save(yourContact);
            session.flush();
            tx.commit();

            List&lt;Contact&gt; contactList = session.createQuery("from Contact").list();
            for (Contact contact : contactList) {
                System.out.println("Id: " + contact.getId() + " | Name:"  + contact.getName() + " | Email:" + contact.getEmail());
            }
        } catch (Exception ex) {
            ex.printStackTrace();
            tx.rollback();
        } finally{
            if(session != null) {
                session.close();
            }
        }
    }
}
</code></pre>