Mike,

the database is running on a production machine:

  Sun MySQL - 5.0.51a
  Linux 2.6.25-14.fc9.x86_64 (amd64)
  Java 1.6

One thing I noticed was that my webhost is using MySQL 5.0.51a, while Wikipedia 
documents 5.1.45 as the most recent stable release.  The JDBC driver is 
provided by the host.

I am not sure why they are using 5.0.51a. Could this cause a problem with 
Cayenne?

Joe




On Apr 16, 2010, at 6:07 PM, Mike Kienenberger wrote:

> Someone more knowledgable would have to comment, but my suspicion is
> that the problem is with your database or JDBC driver rather than with
> Cayenne.
> 
> Perhaps if you describe your database setup (database, version,
> anything else relevent), someone might have some additional ideas.
> 
> You might also try searching on the SQLException.  Here's one
> interesting hit I found:
> 
> http://forums.mysql.com/read.php?22,37371,39620#msg-39620
> 
> 
> On Fri, Apr 16, 2010 at 5:57 PM, Joe Baldwin <[email protected]> wrote:
>> Michael & Andrus,
>> 
>> The DataSource Factory specified in CM is:
>> 
>>        org.apache.cayenne.conf.DriverDataSourceFactory
>> 
>>> I've deployed a long-running (up 24x7) internal application before
>>> that had a max of 2 DB connections ...
>> 
>> 
>> Interesting - I saw one of you examples in which you used min = max = 1.  So 
>> this is not expected behavior at all.
>> 
>> The catalina log reported an exception (just prior to the connection 
>> exception)
>> 
>>        java.sql.SQLException: Lock wait timeout exceeded;  (see detail in 
>> attached file)
>> 
>> Is it possible that I have inadvertently configured improper locking?   
>> (Note: I never explicitly set locking.)
>> 
>> The only theory I can think of at this point is *really* bizarre: is it 
>> possible content editing of one product is locking the entire list of 
>> products?  (The ProductDetail class is a JSP that simply displays a Product. 
>>  At the same time, there is content editing going on.  My expectation would 
>> be that there is row-level locking and that this would not interfere with 
>> displaying a row.)
>> 
>> RE open connections (I thought the PoolManager might report that, if my 
>> session gets one auto-magically).
>> 
>> Thanks,
>> Joe
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> On Apr 16, 2010, at 8:57 AM, Michael Gentry wrote:
>> 
>>> Hi Joe,
>>> 
>>> I've deployed a long-running (up 24x7) internal application before
>>> that had a max of 2 DB connections using the built-in Cayenne
>>> connection pooling mechanism and never had any issues with running out
>>> of connections.  The only reason I even used 2 was I had long-running
>>> (several minutes) queries in a background thread that might block the
>>> interactive portion and make the user wait during those periods, so I
>>> basically allocated one to the background thread and one to the user
>>> threads.
>>> 
>>> I don't know of a way to report open connections off the top of my
>>> head, but I could look into that if needed.
>>> 
>>> mrg
>>> 
>>> 
>>> On Thu, Apr 15, 2010 at 8:57 AM, Joe Baldwin <[email protected]> 
>>> wrote:
>>>> Hi Michael,
>>>> 
>>>> min = 1
>>>> max = 10 (we changed this to 20 but then got the same error)
>>>> 
>>>> To my knowledge there are no long running transactions.  Most are product 
>>>> list fetches which should take less than a second each.  There is some 
>>>> content editing right now, so there are about 50-100 updates per day, 
>>>> (which again should take no more than 1 sec per transaction)
>>>> 
>>>> I have been searching through my code, but can't find anything that seems 
>>>> out of the ordinary.
>>>> 
>>>> Is there an object available to me that will report open connections?
>>>> 
>>>> Thanks,
>>>> Joe
>>>> 
>>>> 
>>>> On Apr 15, 2010, at 8:18 AM, Michael Gentry wrote:
>>>> 
>>>>> The connections are stored and reused.  What is your min/max setting?
>>>>> Do you have any long-running transactions?
>>>>> 
>>>>> 
>>>>> On Wed, Apr 14, 2010 at 11:34 PM, Joe Baldwin <[email protected]> 
>>>>> wrote:
>>>>>> Why would the DataContext be running out of connections in a web app 
>>>>>> with only a small amount of traffic?
>>>>>> 
>>>>>> (I thought that a group of connections were stored (base on the modeler 
>>>>>> specification), and then reused for each transaction.)
>>>>>> 
>>>>>> Joe
>>>>>> 
>>>>>> 
>>>> 
>>>> 
>> 
>> 
>> 

Reply via email to