[The Java Posse] Re: JDBCTemplete question

2009-08-04 Thread Oliver Gierke
Hey out there, using JdbcTemplate in Websphere caused some connection pooling issues for us, too. What turned out to be the problem was us using the DataSourceTransactioManager instead of the one dedicated to WebSphere. So in cases of polling problems check if you use the right one :) Regards Ol

[The Java Posse] Re: JDBCTemplete question

2009-08-03 Thread Christian Catchpole
One thing you could do is call getConnection() twice and then System.out.println( con1 == con2 ) Then email him the 'false' response. He can't deny that. On Aug 4, 12:42 am, Arulin of ACBL wrote: > Thankyou all, > > The getConnection() was our senior level Java developer's idea... > Kinda fig

[The Java Posse] Re: JDBCTemplete question

2009-08-03 Thread Arulin of ACBL
Thankyou all, The getConnection() was our senior level Java developer's idea... Kinda figured JDBCTemplete would buck that but no way I was going to prove it to him. Seriously, no one here trust me (alittle HADD) so I'll have to run this through him, at least I have this information to back me up

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Keith Haber
Agreed. Personally I'd get rid of the isJDBCConnectionClosed() method entirely, for a few reasons. First, as Mike and Mark say, each call to getDataSource().getConnection () is grabbing a new connection from the DataSource, so it looks like you're leaving a lot of connections open that JdbcTempl

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Mwanji Ezana
Thanks for that, I'd been looking around for how to do that, but had been looking in Java > Editor > Templates instead of Java > Code Style > Code Templates. The Eclipse preferences are vast and confusingly organised... Mwanji --~--~-~--~~~---~--~~ You received thi

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Rakesh
exacttly - the whole point of JdbcTemplate is that you do not need to do any connection management. Spring 101. R On Sat, Aug 1, 2009 at 8:53 AM, Colin B-S wrote: > > Keith is right, this is more likely to be your configuration in > WebSphere. > Also the JDBCTemplate will close your connection

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Colin B-S
Keith is right, this is more likely to be your configuration in WebSphere. Also the JDBCTemplate will close your connection for you. If the connection is configured as a pooled connection then the close() just returns it to the pool. Colin. On Jul 31, 3:14 pm, Arulin of ACBL wrote: > Hello Java

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Dominic Mitchell
On 1 Aug 2009, at 08:00, Dominic Mitchell wrote: > On 31 Jul 2009, at 15:14, Arulin of ACBL wrote: >> } catch (SQLException e) { >> // TODO Auto-generated catch block >> e.printStackTrace(); >> } > > I hate Eclipse sometimes. Sorr

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Christian Catchpole
that's what I said! :) geesh :) On Aug 1, 5:44 pm, Mark Derricutt wrote: > Hmm didn't spot that to start with - I'd say your right.  A new > connection would be pulled from the pool and closed, leaving the > original connection still "open". > -- > > > > On Sat, Aug 1, 2009 at 7:41 PM, Mike Jon

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Mark Derricutt
Hmm didn't spot that to start with - I'd say your right. A new connection would be pulled from the pool and closed, leaving the original connection still "open". -- On Sat, Aug 1, 2009 at 7:41 PM, Mike Jones wrote: > Isn't > this.getDataSource().getConnection().close() asking for a connection >

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Mike Jones
Aren't the chained method calls to this.getDataSource().getConnection()... a bit suspect? Aren't they trying to pull a fresh connection of the pool each time but then aren't being closed. Isn't this.getDataSource().getConnection().close() asking for a connection from the pool and then closing (ret

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Christian Catchpole
Again, i dont know much about JDBCtemplete but i would expect you need to jump though hoops to close connections. This should be managed.. that doesnt answer your question but you could be barking up the wrong binary tree. (Datasources don't give you real connections anyway. not the good ones a

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Mark Derricutt
Interestingly, I'm currently also trying to diagnose some oddness with JdbcTemplate as well, whilst the code looks like its closing the Response, the Statement, and the Connection - my connection pool (Atomikos) decides to log several hundred 'warnings' that its forcing statements closed cause the

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Christian Catchpole
I don't anything about JDBCtemplete but would this.getDataSource ().getConnection() give you a new connection every time? rather than a single instance as this code expects? (or am i on crack). On Aug 1, 5:00 pm, Dominic Mitchell wrote: > On 31 Jul 2009, at 15:14, Arulin of ACBL wrote: > > >

[The Java Posse] Re: JDBCTemplete question

2009-08-01 Thread Dominic Mitchell
On 31 Jul 2009, at 15:14, Arulin of ACBL wrote: > } catch (SQLException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } I hate Eclipse sometimes. -Dom --~--~-~--~~~---~--~---

[The Java Posse] Re: JDBCTemplete question

2009-07-31 Thread Paul King
Knowing what version of Spring you are using might also be handy. On Sat, Aug 1, 2009 at 12:14 AM, Arulin of ACBL wrote: > > Hello Java Posse, > > Our system Admin is tearing his hair out over JDBCtemplete, it is not > closing threads that it opens between Websphere App Server and DB2, we > are o

[The Java Posse] Re: JDBCTemplete question

2009-07-31 Thread Keith Haber
My understanding is that Spring JDBC's JdbcTemplate just gets Connections from the DataSource object -- it doesn't spin up threads on its own. I'd look at the DataSource configuration, as that's where the connection and thread pooling ought to be happening. What does your DataSource's JNDI confi