title: Why my data does not get persisted?
body: <p>I am using JPA and Java Embedded DB in my application. I try to write some data to the database and when i try to read it back I am able to do it. But the application is closed and when I open it again none of the data exists.</p>
  
  <p>Here is my persistence.xml file</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt;
    &lt;persistence-unit name="myMoneyPU" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
      &lt;class&gt;mymoney.Money&lt;/class&gt;
      &lt;properties&gt;
        &lt;property name="eclipselink.jdbc.password" value="adminadmin"/&gt;
        &lt;property name="eclipselink.jdbc.user" value="admin"/&gt;
        &lt;property name="eclipselink.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/&gt;
        &lt;property name="eclipselink.jdbc.url" value="jdbc:derby:pocketmoney;create=true"/&gt;
        &lt;property name="eclipselink.ddl-generation" value="create-tables"/&gt;
      &lt;/properties&gt;
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Is there any problem in my database URL.</p>
  
  <blockquote>
    <p>jdbc:derby:pocketmoney</p>
  </blockquote>