I tried following code
Code:
try {
EntityTransaction tx = getEntityManager().getTransaction();
tx.begin();
getEntityManager().persist(entity);
tx.commit();
} catch (RuntimeException re) {
throw re;
}finally {
getEntityManager().close();
EntityManagerFactoryManager.getInstance().close();
}
The Entity is NOT written into Oracle DB,
there is NO ANY EXCEPTIONS!My persistence.xml is
Code:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<persistence-unit name="DataServices" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>jdbc/sbnDataSource</non-jta-data-source>
more classes....
<class>govonca.lrc.moe.sbn.internal.jpa.Application</class>
more classes....
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.connection.autocommit" value="true" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
Any ideas?? Thanks in advance!