You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Charles Moulliard <cm...@gmail.com> on 2011/10/25 07:29:33 UTC
Schema not dropped using Apache Aries JPA and OpenJPA 2.1
Hi,
I have deployed successfully a Aries JPA project (using Aries JPA 0.3)
on Karaf but my DB is not dropped or records removed from the table
when the following option is set in the persistence file
<?xml version="1.0" encoding="UTF-8"?>
<persistence 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_2_0.xsd"
version="2.0">
<persistence-unit name="reportincident" transaction-type="JTA">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<jta-data-source>osgi:service/jdbc/reportincidentdb</jta-data-source>
<class>org.test.model.Incident</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(SchemaAction='dropDB,deleteTableContents')"/>
<property name="openjpa.Log"
value="DefaultLevel=INFO, Runtime=INFO,
Tool=INFO, SQL=TRACE"/>
<property name="openjpa.jdbc.DBDictionary"
value="h2(useSchemaName=true)"/>
<property name="openjpa.jdbc.Schema"
value="REPORT"/>
</properties>
</persistence-unit>
</persistence>
Does anybody knows the reason ?
Regards,
Charles Moulliard
Apache Committer
Blog : http://cmoulliard.blogspot.com
Twitter : http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard
Skype: cmoulliard
Re: Schema not dropped using Apache Aries JPA and OpenJPA 2.1
Posted by Rick Curtis <cu...@gmail.com>.
Charles -
Try configuring SychronizeMappings this way :
<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(SchemaAction='drop,add')"/>
Thanks,
Rick
On Tue, Oct 25, 2011 at 12:29 AM, Charles Moulliard <cm...@gmail.com>wrote:
> Hi,
>
> I have deployed successfully a Aries JPA project (using Aries JPA 0.3)
> on Karaf but my DB is not dropped or records removed from the table
> when the following option is set in the persistence file
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence 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_2_0.xsd"
> version="2.0">
>
> <persistence-unit name="reportincident" transaction-type="JTA">
>
>
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
>
> <jta-data-source>osgi:service/jdbc/reportincidentdb</jta-data-source>
>
> <class>org.test.model.Incident</class>
> <exclude-unlisted-classes>true</exclude-unlisted-classes>
>
> <properties>
> <property name="openjpa.jdbc.SynchronizeMappings"
>
> value="buildSchema(SchemaAction='dropDB,deleteTableContents')"/>
> <property name="openjpa.Log"
> value="DefaultLevel=INFO, Runtime=INFO,
> Tool=INFO, SQL=TRACE"/>
> <property name="openjpa.jdbc.DBDictionary"
> value="h2(useSchemaName=true)"/>
> <property name="openjpa.jdbc.Schema"
> value="REPORT"/>
> </properties>
>
> </persistence-unit>
> </persistence>
>
> Does anybody knows the reason ?
>
> Regards,
>
> Charles Moulliard
>
> Apache Committer
>
> Blog : http://cmoulliard.blogspot.com
> Twitter : http://twitter.com/cmoulliard
> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> Skype: cmoulliard
>
--
*Rick Curtis*