Man...that's crazy, in the command line i executed the commands...and the
message for both
table 'cadastro.message' doesn't exist!!
But in MySql Administrator the table exist!!
it's crazy!!
Thanks!
Michael Dick wrote:
>
> Hi Thiago,
>
> Did you create the tables manually or were they created by the
> SynchronizeMappings property?
>
> If you connect to mysql via the command line ($ mysql -u root -p ) try
> running these statements :
> connect cadastro;
> show create table Message;
>
> show create table cadastro.Message;
>
> If Kevin's theory is right you should see valid SQL for the first show
> create table statement, and an error message (something like Table
> 'cadastro.Message' doesn't exist) for the second one.
>
> If that's the case then it looks like the schema name was omitted
> somewhere.
>
>
> If both tables exist then we're probably looking at a connection issue
> (the
> MySQL driver shouldn't be throwing the exception).
>
> If cadastro.Message exists, and Message doesn't then we have a third
> scenario..
>
> Hope this helps,
> -mike
>
> On Thu, Oct 2, 2008 at 9:21 AM, thiago ananias
> <[EMAIL PROTECTED]>wrote:
>
>>
>>
>> i don't know what's happened but the table exists...
>>
>>
>>
>> Kevin Sutter wrote:
>> >
>> > Thiago,
>> > Just from looking at the information you posted, I'm guessing that the
>> > wrong
>> > schema name is being used somewhere. According to the message you
>> posted,
>> >
>> > 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]
>> >
>> > The missing table is "cadastro.message". You indicate that the
>> "message"
>> > table exists in both databases. But, does the fully-qualified table
>> name
>> > (cadastro.message) exist in mySQL? From the information posted, I
>> don't
>> > see
>> > where you are explicitly setting a schema name. I'm not an expert with
>> > mySQL's default schema name conventions.
>> >
>> > Anyway, that's the first place I would look.
>> >
>> > Good luck,
>> > Kevin
>> >
>> >
>> > On Thu, Oct 2, 2008 at 6:41 AM, thiago ananias
>> > <[EMAIL PROTECTED]>wrote:
>> >
>> >>
>> >>
>> >>
>> >> 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.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://n2.nabble.com/Problems-with-configuring-OpenJPA-%22Slices%22-tp759642p1134001.html
>> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context:
http://n2.nabble.com/Problems-with-configuring-OpenJPA-%22Slices%22-tp759642p1135042.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.