cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Merrin" <dmer...@ipasystems.co.uk>
Subject RE: BindException
Date Mon, 03 Apr 2006 11:01:32 GMT

I sorted this in the end by using the PoolManager rather than the
DriverDataSource. The problem was happening because the connection was being
opened and closed for every query. Each connection took a tcp socket.
Windows (or Java) wasn't cleaning up quick enough hence all the sockets were
getting used up.

Dave

> -----Original Message-----
> From: Dave Merrin [mailto:dmerrin@ipasystems.co.uk]
> Sent: 31 March 2006 18:08
> To: cayenne-user@incubator.apache.org
> Subject: RE: BindException
>
>
> Hi Mike,
>
> sorry I didn't put it in the first message. I didn't have a copy
> of it when
> I send the first message, hence the need to try and reproduce it.
>
> It's just happened again on a client site:
>
> java.net.SocketException: java.net.BindException: Address already in use:
> connect
> 	at
> com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory
> .java:156)
> 	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
> 	at com.mysql.jdbc.Connection.createNewIO(Connection.java:2541)
> 	at com.mysql.jdbc.Connection.<init>(Connection.java:1474)
> 	at
> com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
> 	at
> org.objectstyle.cayenne.conn.DriverDataSource.getConnection(Driver
> DataSource
> .java:151)
> 	at
> org.objectstyle.cayenne.conn.DriverDataSource.getConnection(Driver
> DataSource
> .java:123)
> 	at
> org.objectstyle.cayenne.access.DataNode$TransactionDataSource.getC
> onnection(
> DataNode.java:589)
> 	at
> org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:301)
> 	at
> org.objectstyle.cayenne.access.DataDomainQueryAction.runQuery(Data
> DomainQuer
> yAction.java:298)
> 	at
> org.objectstyle.cayenne.access.DataDomainQueryAction.execute(DataD
> omainQuery
> Action.java:138)
> 	at
> org.objectstyle.cayenne.access.DataDomain.onQuery(DataDomain.java:724)
> 	at
> org.objectstyle.cayenne.access.Transaction.onQuery(Transaction.java:206)
> 	at
> org.objectstyle.cayenne.access.DataDomain.onQuery(DataDomain.java:721)
> 	at
> org.objectstyle.cayenne.util.ObjectContextQueryAction.runQuery(Obj
> ectContext
> QueryAction.java:244)
> 	at
> org.objectstyle.cayenne.access.DataContextQueryAction.execute(Data
> ContextQue
> ryAction.java:88)
> 	at
> org.objectstyle.cayenne.access.DataContext.onQuery(DataContext.java:1261)
> 	at
> org.objectstyle.cayenne.access.DataContext.performQuery(DataContex
> t.java:125
> 0)
> 	at
> ipa.printexpress.data.helpers.Session.fetchEntityCollection(Sessio
> n.java:70)
> 	at ipa.px.data.adapter.PxDataAdapter.fetch(PxDataAdapter.java:124)
> 	at
> ipa.px.data.adapter.ItemNodeAdapter.getItemNodes(ItemNodeAdapter.java:71)
> 	at
> ipa.px.data.adapter.ItemNodeAdapter.getItemNodes(ItemNodeAdapter.java:56)
> 	at
> ipa.px.data.adapter.ItemNodeAdapter.getItemByItemId(ItemNodeAdapte
> r.java:634
> )
> 	at
> ipa.px.data.provider.PxItemNodeProvider.getItemsByItemId(PxItemNod
> eProvider.
> java:262)
> 	at
> ipa.px.tracker.logimporter.actions.AbstractAction.saveItem(Abstrac
> tAction.ja
> va:311)
> 	at
> ipa.px.tracker.logimporter.actions.AbstractAction.defaultCreateIte
> mAction(Ab
> stractAction.java:139)
> 	at
> ipa.px.tracker.logimporter.actions.LogSeparationAction.doAction(Lo
> gSeparatio
> nAction.java:35)
> 	at
> ipa.px.tracker.logimporter.msgrouter.MessageRouter.run(MessageRout
> er.java:13
> 7)
> 	at
> ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker.runIt(Threa
> dPoolWorke
> r.java:121)
> 	at
> ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker.runWork(Thr
> eadPoolWor
> ker.java:103)
> 	at
> ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker.access$000(
> ThreadPool
> Worker.java:21)
> 	at
> ipa.px.tracker.logimporter.threadpool.ThreadPoolWorker$1.run(Threa
> dPoolWorke
> r.java:62)
> 	at java.lang.Thread.run(Unknown Source)
>
> > -----Original Message-----
> > From: Mike Kienenberger [mailto:mkienenb@gmail.com]
> > Sent: 31 March 2006 17:39
> > To: cayenne-user@incubator.apache.org
> > Subject: Re: BindException
> >
> >
> > What's the stack trace look like?
> >
> > On 3/31/06, Dave Merrin <dmerrin@ipasystems.co.uk> wrote:
> > > Hi,
> > >
> > > I get a bind exception when I'm doing large numbers of queries
> > very quickly.
> > > I did some optimization which eliminated the exceptions on my
> > machine but
> > > now I'm getting them on a different machine which is heavily loaded.
> > >
> > > I'm using MySql5 and Cayenne M11.
> > >
> > > Are there any connections I should be closing between calls?
> > All queries are
> > > done from the same DataContext and on the same thread (only one
> > thread for
> > > this DataContext).
> > >
> > > I'll try and produce some code to reproduce the problem. In the
> > meantime can
> > > anybody help?
> > >
> > > Dave
> > >
> > >
> >
>


Mime
View raw message