Re: Database Connection Question
Re: Database Connection Question
- Subject: Re: Database Connection Question
- From: Dev WO <email@hidden>
- Date: Tue, 23 Nov 2010 11:02:33 +0100
Hello Gennady,
> Hello Chuck and others.
> I'd like ask some more questions )
>
> 2010/8/27 Chuck Hill <email@hidden>:
>>
>> On Aug 25, 2010, at 11:10 PM, Dov Rosenberg wrote:
>>
>>> I am revisiting some old EOF documentation and wanted to make sure I understood a few things. Are the following statements true?
>>>
>>>
>>> * When an EOModel is found and connected to a database when the app starts up each database connection is mapped to an EODatabaseChannel?
>>
>> I think that EODatabaseContext is more correct than EODatabaseChannel. The context will then use the channel. A db context can handle multiple models (the connection information needs to be the same).
>
> How can single db context handle multiple models ? I see that
> EODatabaseContext.forceConnectionWithModel(model,cd,ec)
> returns different objects for different models, whereas most of my
> models point to the same database with the same connection dictionary.
> And would it make sense to somehow force all these models to single db context?
If you are using Wonder, you could use the following in your Properties file
## Class name to use instead of the JDBCAdaptor, the ERXJDBCAdaptor supports
## connection pooling
er.extensions.ERXJDBCAdaptor.className=er.extensions.jdbc.ERXJDBCAdaptor
>
>>> Is there a default number of EODatabaseChannels opened when the app starts up? Is there a configuration setting that I can set to add more?
>>
>> One per db context and no.
> My problem is that I see my app opening more connections than a number
> of models it has.
> And those connections do not close even after more than an hour not
> used. And it does not reuse all of them for later requests but may
> create even more connections.
> As a result when running multiple instances on a server with limited
> DB-connections I do get "too many connections" error sometimes.
>
> How could I fight it? Is it possible to control the number of open
> connections and close unused ones after certain idle time?
Can't respond on this one, but the property above should fix all this.
Xavier
>
> Gennady Kushnir
>
>> Chuck
>>
>>
>> --
>> Chuck Hill Senior Consultant / VP Development
>>
>> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
>> http://www.global-village.net/products/practical_webobjects
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden