db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul French" <paul.fre...@kirona.com>
Subject RE: Embedded Derby + J2ME + JDBC Connection Pooling
Date Thu, 09 Oct 2008 08:48:27 GMT
Thanks,

I'll try without a database connection pool for now. I will probably be in
the order of 10 connections per second at peek.

Cheers
Paul

-----Original Message-----
From: Knut.Hatlen@Sun.COM [mailto:Knut.Hatlen@Sun.COM] 
Sent: 09 October 2008 09:15
To: Derby Discussion
Subject: Re: Embedded Derby + J2ME + JDBC Connection Pooling

Paul French <paul.french@kirona.com> writes:

> Hello All,
>  
> I create an EmbeddedSimpleDataSource in my code. My application is 
> multi-threaded. I assume EmbeddedSimpleDataSource is thread safe from 
> the point of view of obtaining connections.
>  
> What is the cost of getting a connection each time I need to do some 
> database work? (Derby is running embedded in my application)
>  
> If the cost is high then I would like to use a light weight Connection 
> Pool Manager similar to Apache Commons DBCP, any ideas of a good 
> implementation that works on J2ME Personal Profile 1.1.2

Creating connections in embedded Derby is a very cheap operation compared to
creating connections to a database server over the network, so you won't see
the same performance improvements with connection pooling as in a
traditional database environment. There is a one-time cost when you set up a
connection (creating the connection object, transaction object, context
stack, etc.) that you will save if you have a pool. Whether or not it's
worth it depends on how frequently your application creates a new
connection. If it does it once every five seconds, I doubt that you'll
notice the difference. If it creates many connections (like tens or
hundreds) per second, you'll be more likely to see an improvement.

--
Knut Anders

__________ NOD32 3505 (20081008) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



Mime
View raw message