did you look openjpa.jdbc.Schema too?

but once again maybe fwd it to openjpa@

Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2013/7/16 Leonardo K. Shikida <[email protected]>
>
> Hi Romain
>
> probably is, because I've tried
>
>   <!--http://openjpa.apache.org/faq.html-->
>   <!-- does not create foreign keys, creates schema and deletes
> content of a database
>        (deleteTableContents - foreign keys are created twice???), use
> dropDB instead -->
>   <property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema(foreignKeys=true,schemaAction='dropDB,add')"/>
>   <!--Resolves the problem with foreign key integrity - joined
> entities are persisted sometimes in wrong order??? (verify it)-->
>   <property name="openjpa.jdbc.SchemaFactory"
> value="native(foreignKeys=true)" />
>   <!--Create foreign keys-->
>   <property name="openjpa.jdbc.MappingDefaults"
> value="ForeignKeyDeleteAction=restrict,
> JoinForeignKeyDeleteAction=restrict"/>
>   <property name="openjpa.Log" value="DefaultLevel=TRACE,SQL=TRACE" />
>
> and then it create almost all the entities... in the wrong user :-)
>
> I have an schema for quartz, another for jms and another for entities
(JPA)
>
> it created the JPA entities in quartz...
>
> I haven't digged all the logs yet, but it seems it tries to get some
> jdbc connection to create the tables, finds null and then fallback to
> the first one it finds (in this case, it seems it was quartz), but I
> am not sure of that yet.
>
> I don't know if it's related, but I remember when I've worked with
> dbUnit that Oracle sometimes needs to know the "schema" to be the same
> as the "user".
>
> []
>
> Leo
>
>
> On Tue, Jul 16, 2013 at 1:57 PM, Romain Manni-Bucau
> <[email protected]> wrote:
> > Hi,
> >
> > I got issues with schema for the init of the base when having mutiple
> > schemas. Is it your case?
> >
> > Ps: maybe openjpa list is more adapted
> > Le 16 juil. 2013 18:46, "Leonardo K. Shikida" <[email protected]> a
écrit :
> >
> >> Hi
> >>
> >> I have an app that was creating entities fine in mysql and it does not
> >> when I try on oracle.
> >>
> >> The error message does not help much
> >>
> >> INFO: Starting OpenJPA 2.2.0
> >> Jul 16, 2013 3:58:27 PM null
> >> INFO: Using dictionary class
> >> "org.apache.openjpa.jdbc.sql.OracleDictionary".
> >> javax.ejb.EJBException: The bean encountered a non-application
> >> exception; nested exception is:
> >>         <openjpa-2.2.0-r422266:1244990 fatal store error>
> >> org.apache.openjpa.persistence.OptimisticLockException: Unable to
> >> obtain an object lock on "null".
> >>         at
> >>
org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
> >>         at
> >>
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
> >> (...)
> >> Caused by: <openjpa-2.2.0-r422266:1244990 fatal store error>
> >> org.apache.openjpa.persistence.OptimisticLockException: Unable to
> >> obtain an object lock on "null".
> >>         at
> >> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4900)
> >>         at
> >>
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4878)
> >>         at
> >>
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
> >>         at
> >>
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:118)
> >>         at
> >>
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:70)
> >> (...)
> >> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException:
> >> ORA-00942: table or view does not exist
> >>  {prepstmnt 219199633 SELECT t0.id, t0.name FROM SiteType t0}
> >> [code=942, state=42000]
> >>         at
> >>
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:247)
> >>         at
> >>
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:231)
> >>         at
> >>
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:72)
> >>         at
> >>
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1146)
> >>         at
> >>
org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:265)
> >>         at
> >>
org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1750)
> >> (..)
> >>         ... 111 more
> >>
> >> my persistence.xml has
> >>
> >>     <properties>
> >>       <property name="openjpa.jdbc.DBDictionary"
> >> value="org.apache.openjpa.jdbc.sql.OracleDictionary"/>
> >>       <property name="openjpa.jdbc.SynchronizeMappings"
> >> value="buildSchema(ForeignKeys=true)"/>
> >>     </properties>
> >>
> >> any ideas?
> >>
> >> TIA
> >>
> >> Leo
> >>

Reply via email to