Re: AW: [OJB-developers] ERROR: Server configuration denies access to data source
Brought to you by:
thma
From: Darren S. <Dar...@cw...> - 2002-02-21 13:44:34
|
Thomas, A couple of questions: - Isn't this kind of code going to have to replicated throughout the entire framework - wherever createPersistenceBroker is called ? - Shouldn't the releaseInstance be done within a finally block to ensure the broker is released in the event of an exception being thrown ? Regards Darren |--------+----------------------------> | | Mahler Thomas | | | <thomas.mahler@ite| | | llium.com> | | | | | | 02/21/02 09:40 AM | | | | |--------+----------------------------> >----------------------------------------------------------------------------| | | | To: 'Ricardo Argello' <ri...@ya...>, Alex Cruise | | <ac...@in...>, "Objectbridge (E-Mail)" | | <obj...@li...> | | cc: (bcc: Darren Syzling/London/CWB) | | Subject: AW: [OJB-developers] ERROR: Server configuration denies | | access to data source | >----------------------------------------------------------------------------| Hi Ricardo, I had a look at the Proxy stuff. I believe that there is a bug in the Class ojb.broker.accesslayer.IndirectionHandler. Please replace the method materializeSubject with the following code: private synchronized void materializeSubject() throws PersistenceBrokerException { beforeMaterialization(); realSubject = getBroker().getObjectByIdentity(id); // release broker after use !!! PersistenceBrokerFactory.releaseInstance(broker); if (realSubject == null) { LoggerFactory.getDefaultLogger().warn("OJB broker could not materialize " + id.toString()); } afterMaterialization(); } The Problem: With the new feature of a pool of brokers in the the PersistenceBrokerFactory all obtained instances must be released after use! The InvovationHandler just not did this. Thus the PersistenceBrokerFactory generated tons of fresh broker instances that all have their own JDBC connections. Please tell me if this patch fixes you problem. Thomas > -----Ursprngliche Nachricht----- > Von: Ricardo Argello [mailto:ri...@ya...] > Gesendet: Donnerstag, 21. Februar 2002 00:54 > An: Alex Cruise; Objectbridge (E-Mail) > Betreff: Re: [OJB-developers] ERROR: Server configuration > denies access > to data source > > > > After I got this exception, I tried to login to the database > using the "mysql" command line program, and it gave me this error: > > ERROR 1040: Too many connections > > Thant's why I'm sure it's a connection limit problem. > > Thanks! > > Ricardo > > > > ----- Original Message ----- > From: "Alex Cruise" <ac...@in...> > To: "Objectbridge (E-Mail)" > <obj...@li...> > Sent: Wednesday, February 20, 2002 5:48 PM > Subject: RE: [OJB-developers] ERROR: Server configuration > denies access to data source > > > From: Ricardo Argello [mailto:ri...@ya...] > > > It turns out that this error: > > java.sql.SQLException: Server configuration denies access > > to data source > > > > was caused because MySql used its "max_connections" limit of 100. > > > > I tried to initialize MySql with a parameter of > > max_connections=1000, but it gave me the same error. > > Are you sure? I usually see this error when there's a > permissions problem. > > -0xe1a > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > _______________________________________________ Objectbridge-developers mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |