openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thiago ananias <thiagoanan...@hotmail.com>
Subject Re: Problems with configuring OpenJPA "Slices"
Date Thu, 02 Oct 2008 11:41:33 GMT



Pinaki Poddar wrote:
> 
> Hi,
>    Thanks for finding this bug.
>    
>    The correction will appear in next nightly build of OpenJPA [1].
> 
>     Those of you using Slice, if you can give us little bit of background
> of your project, that will be very helpful for us to decide on its future
> course.
> 
> Pinaki
> 

Hi again people, thanks for the reply "ahsoni"!!!

I'm with other problem now...this error appears for me:

But the table "message" exists in both databases...

Exception in thread "main" <openjpa-1.2.0-rexported nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: Table
'cadastro.message' doesn't exist {prepstmnt 18481629 SELECT t0.id,
t0.created, t0.message FROM Message t0} [code=1146, state=42S02]
        at
org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4238)
        at
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4203)
        at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
        at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
        at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
        at
org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155)
        at
org.apache.openjpa.lib.rop.MergedResultObjectProvider.handleCheckedException(MergedResultObjectProvider.java:148)
        at
org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:40)
        at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1228)
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:990)
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:805)
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:775)
        at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:771)
        at
org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:517)
        at
org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:254)
        at
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:293)
        at br.unicsul.teste.Main.main(Main.java:49)


And my persistence.xml
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">

    <persistence-unit name="PersistenceUnit"
transaction-type="RESOURCE_LOCAL">

       
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
        <class>br.unicsul.teste.Message</class>

        <properties>

            <!-- HABILITA O GERENCIAMENTO DE BDs -->
            <property name="openjpa.BrokerFactory" value="slice"/>
            <property name="openjpa.slice.Names" value="SQLSERVER,MYSQL"/>
            <property name="openjpa.slice.Master" value="SQLSERVER"/>

            <property name="openjpa.ConnectionURL"
value="jdbc:sqlserver://TANANIAS-D\SQLEXPRESS;database=cadastro;user=sa;password=testando123"/>
            <property name="openjpa.ConnectionDriverName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>


            <property name="openjpa.slice.SQLSERVER.ConnectionURL"
value="jdbc:sqlserver://TANANIAS-D\SQLEXPRESS;database=cadastro;user=sa;password=testando123"/>
            <property name="openjpa.slice.SQLSERVER.ConnectionDriverName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>

            <property name="openjpa.slice.MYSQL.ConnectionURL"
value="jdbc:mysql://localhost:3306/cadastro"/>            
            <property name="openjpa.slice.MYSQL.ConnectionDriverName"
value="com.mysql.jdbc.Driver"/>
            <property name="openjpa.slice.MYSQL.ConnectionUserName"
value="root"/>
            <property name="openjpa.slice.MYSQL.ConnectionPassword"
value="sa"/>
            
            <property name="openjpa.Log" value="DefaultLevel=WARN,
Enhance=TRACE"/>
            <property name="openjpa.slice.DistributionPolicy"
value="br.unicsul.teste.DistributionRules"/>

<!--
            <property name="openjpa.slice.Two.jdbc.SynchronizeMappings"
value="buildSchema(SchemaAction='drop,add')"/>  
            <property name="openjpa.slice.Two.Log" value="DefaultLevel=WARN,
Tool=INFO"/>
            <property name="openjpa.slice.Two.ConnectionFactoryProperties"
value="PrettyPrint=true, PrettyPrintLineLength=80"/>
-->

        </properties>

    </persistence-unit>

</persistence>



i don't know what's wrong because in the SQLSERVER(master slice) the message
is commited with sucess but in MYSQL occurs this error!

Thanks for the help!

bye








-- 
View this message in context: http://n2.nabble.com/Problems-with-configuring-OpenJPA-%22Slices%22-tp759642p1133677.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message