You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jeremy Taylor <jt...@yahoo.com> on 2004/08/30 15:51:18 UTC

Re: Connection load

My client wants to track user interaction with the
database on an individual level, therefore I'm not
using a datasource. I'm I looking at more of a load by
making a direct connection to the database instead of
to a connection pool?


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Connection load

Posted by John Villar <jo...@florhard.com>.
I'm using in my app one to three connections per concept, and it works 
perfectly... i think that's a good general rule: Use one connection per 
concept, and one connection for its List container....

QM escribió:

>On Mon, Aug 30, 2004 at 08:06:18AM -0700, Jeremy Taylor wrote:
>: My problem is the requirement that the dba must track
>: all user interaction on the database side.
>
>Then it's time to talk with your DBA/management about realistic app
>requirements. =) You've already seen the discussion here about the
>performance drag you (and your users) will experience if you use one
>connection per user.  Furthermore, you've complicated your database
>setup: each app user must also exist as a DB user.
>
>If you can't convince the proper people to let you track this at the app
>side, there's not much I can do for you.
>
>-QM
>
>  
>

-- 
John Villar
Gerente de Proyectos
Computadores Flor Hard Soft 2058 C.A.
www.florhard.com



Re: Connection load

Posted by Jeremy Taylor <jt...@yahoo.com>.
I complete understand what your saying. Yes, they have
already complicated it because everyone is already a
DB user. I'm now looking into jstl. I've found a
servlet that makes a connection to the database and
initializes a session datasource. This should reduce
the db connections to one per user per session and
keep the dba's happy as well.


 
--- QM <qm...@brandxdev.net> wrote:

> On Mon, Aug 30, 2004 at 08:06:18AM -0700, Jeremy
> Taylor wrote:
> : My problem is the requirement that the dba must
> track
> : all user interaction on the database side.
> 
> Then it's time to talk with your DBA/management
> about realistic app
> requirements. =) You've already seen the discussion
> here about the
> performance drag you (and your users) will
> experience if you use one
> connection per user.  Furthermore, you've
> complicated your database
> setup: each app user must also exist as a DB user.
> 
> If you can't convince the proper people to let you
> track this at the app
> side, there's not much I can do for you.
> 
> -QM
> 
> -- 
> 
> software  -- http://www.brandxdev.net
> tech news -- http://www.RoarNetworX.com
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Connection load

Posted by QM <qm...@brandxdev.net>.
On Mon, Aug 30, 2004 at 08:06:18AM -0700, Jeremy Taylor wrote:
: My problem is the requirement that the dba must track
: all user interaction on the database side.

Then it's time to talk with your DBA/management about realistic app
requirements. =) You've already seen the discussion here about the
performance drag you (and your users) will experience if you use one
connection per user.  Furthermore, you've complicated your database
setup: each app user must also exist as a DB user.

If you can't convince the proper people to let you track this at the app
side, there's not much I can do for you.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Connection load

Posted by Jeremy Taylor <jt...@yahoo.com>.
My problem is the requirement that the dba must track
all user interaction on the database side. Will the
dba be able to track this if I'm using a connection
factory or DAO?


--- Peter Lin <wo...@gmail.com> wrote:

> it might be redundant and those who do lots of
> databse work will
> already know this, but if you don't use DB
> connection pool, the
> minimum connection time will be atleast 100ms.  If
> you really want to
> log the database queries, I would suggest writing a
> database factory
> and having the database abstraction layer write to
> the log.
> 
> on larger/mission critical applications, the queries
> are logged for
> reporting and management purposes. Most people don't
> do this, but
> sites with Service Level Agreements keep track of
> database queries and
> run reports nightly to make sure the query times are
> not degrading.
> 
> If performance is of any importance to you, making a
> new connection
> for each request is most likely the wrong approach.
> A simple database
> factory factory should be sufficient to log the
> query string to a file
> along with other additional data you need to run
> reports.
> 
> I hope that helps
> 
> peter
> 
> 
> 
> On Mon, 30 Aug 2004 09:43:23 -0500, QM
> <qm...@brandxdev.net> wrote:
> > On Mon, Aug 30, 2004 at 06:51:18AM -0700, Jeremy
> Taylor wrote:
> > : My client wants to track user interaction with
> the
> > : database on an individual level, therefore I'm
> not
> > : using a datasource. I'm I looking at more of a
> load by
> > : making a direct connection to the database
> instead of
> > : to a connection pool?
> > 
> > 1/ please post a *new* message when writing to the
> list.  Replying to
> > an old (unrelated) message confuses thread-aware
> mailers, which makes
> > your question harder to find (and thus answer).
> > 
> > 2/ If your app uses DB abstraction layers, you
> could still tie the
> > (Tomcat/Realm) username to DB access instead of
> using direct DB logins.
> > Simply track which user calls the method on a DAO
> and go from there.
> > 
> > 3/ You'll probabaly get more load using per-user
> connections, yes.  One
> > reason DB pooling was created was to keep DB
> connections open.
> > Otherwise, you have to initiate the network
> connection, login to the
> > database, etc for each DB call.
> > 
> > -QM
> > 
> > --
> > 
> > software  -- http://www.brandxdev.net
> > tech news -- http://www.RoarNetworX.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> > 
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 
> 



		
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Connection load

Posted by Peter Lin <wo...@gmail.com>.
it might be redundant and those who do lots of databse work will
already know this, but if you don't use DB connection pool, the
minimum connection time will be atleast 100ms.  If you really want to
log the database queries, I would suggest writing a database factory
and having the database abstraction layer write to the log.

on larger/mission critical applications, the queries are logged for
reporting and management purposes. Most people don't do this, but
sites with Service Level Agreements keep track of database queries and
run reports nightly to make sure the query times are not degrading.

If performance is of any importance to you, making a new connection
for each request is most likely the wrong approach. A simple database
factory factory should be sufficient to log the query string to a file
along with other additional data you need to run reports.

I hope that helps

peter



On Mon, 30 Aug 2004 09:43:23 -0500, QM <qm...@brandxdev.net> wrote:
> On Mon, Aug 30, 2004 at 06:51:18AM -0700, Jeremy Taylor wrote:
> : My client wants to track user interaction with the
> : database on an individual level, therefore I'm not
> : using a datasource. I'm I looking at more of a load by
> : making a direct connection to the database instead of
> : to a connection pool?
> 
> 1/ please post a *new* message when writing to the list.  Replying to
> an old (unrelated) message confuses thread-aware mailers, which makes
> your question harder to find (and thus answer).
> 
> 2/ If your app uses DB abstraction layers, you could still tie the
> (Tomcat/Realm) username to DB access instead of using direct DB logins.
> Simply track which user calls the method on a DAO and go from there.
> 
> 3/ You'll probabaly get more load using per-user connections, yes.  One
> reason DB pooling was created was to keep DB connections open.
> Otherwise, you have to initiate the network connection, login to the
> database, etc for each DB call.
> 
> -QM
> 
> --
> 
> software  -- http://www.brandxdev.net
> tech news -- http://www.RoarNetworX.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Connection load

Posted by QM <qm...@brandxdev.net>.
On Mon, Aug 30, 2004 at 06:51:18AM -0700, Jeremy Taylor wrote:
: My client wants to track user interaction with the
: database on an individual level, therefore I'm not
: using a datasource. I'm I looking at more of a load by
: making a direct connection to the database instead of
: to a connection pool?


1/ please post a *new* message when writing to the list.  Replying to
an old (unrelated) message confuses thread-aware mailers, which makes
your question harder to find (and thus answer).

2/ If your app uses DB abstraction layers, you could still tie the
(Tomcat/Realm) username to DB access instead of using direct DB logins.
Simply track which user calls the method on a DAO and go from there.

3/ You'll probabaly get more load using per-user connections, yes.  One
reason DB pooling was created was to keep DB connections open.
Otherwise, you have to initiate the network connection, login to the
database, etc for each DB call.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org