geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Still remaining problems using openJPA
Date Mon, 23 Jul 2007 21:26:03 GMT

On Jul 23, 2007, at 10:54 AM, Dain Sundstrom wrote:

> On Jul 23, 2007, at 9:40 AM, Ueberbach, Michael wrote:
>
>> Hello,
>>
>> meanwhile I got along a bit further in deploying and using an EJB  
>> 3.0 application on g2 (M6). But there still remain some open  
>> questions:
<snip>


>> 3. The most important and irritating problem is the following:
>>
>>   After starting the database and then geronimo the first access  
>> to persistent data by an ejb method results in the following  
>> exception:
>>
>>   ERROR [OpenEJB] The bean instances business method encountered a  
>> system exception: Access denied for user 'geronimo'@'localhost' to  
>> database 'GERONIMO_DB'
>>
>>   <1.0.0-SNAPSHOT-SNAPSHOT nonfatal general error>  
>> org.apache.openjpa.persistence.PersistenceException: Access denied  
>> for user 'geronimo'@'localhost' to database 'GERONIMO_DB'
>>
>>   The access is denied because the name of the database is  
>> geronimo_db (lower cases) and MySQL on linux works case-sensitive.  
>> But the correct writing
>>
>>   of the name has been used when deploying the database pool.
>>
>>   What is most astonishing is the following!!!
>>
>>   After stopping the database the attempt to get access to data  
>> results in
>>
>>   [MCFConnectionInterceptor] Error occurred creating  
>> ManagedConnection for  
>> org.apache.geronimo.connector.outbound.ConnectionInfo@e99cbc
>>
>>   javax.resource.spi.ResourceAllocationException: Unable to obtain  
>> physical connection to jdbc:mysql://localhost:3306/geronimo_db
>>
>>   at org.tranql.connector.jdbc.JDBCDriverMCF.getPhysicalConnection 
>> (JDBCDriverMCF.java:98)
>>
>>   This is clear and expectable. But ...
>>
>>   after starting the database again: Everything works!
>>   I can reproduce the whole thing. Conclusion at the moment is: To  
>> get a working connection to the database I have to force the above  
>> error situation first. Very strange!
>>
>>   May someone has an idea about this behaviour?
> This is something we should be able to help you with.   
> Unfortunately, I this isn't my area, but hopefully David Jencks  
> will respond quickly :)
>
This is pretty bizarre :-)

Could you show your plans for setting up the mysql datasource(s) and  
the persistence.xml you are using?

Also, I'm not sure about the sequence of all the steps involved....   
what is creating the tables in the db?  A script? openjpa? Something  
else?  If a script, how is it run?

For instance I wonder if steps like this would make any difference:
- if you are using a script:
start db
create tables
stop db
start db
start geronimo (or deploy/start your datasource + application)

If you are letting openjpa create your tables, do you have a non-jta- 
datasource specified?  I could not get derby to work with openjpa  
without a non-jta-datasource.  I stopped investigating why after a  
lot of frustration, but one symptom was that a connection that had  
been used outside a jta transaction to execute ddl or updating the  
sequence table appeared to lose track of the schema it was supposed  
to be using by default.  So I suggest adding a non-jta-datasource if  
you don't have one.

  thanks
david jencks


> -dain
>


Mime
View raw message