Personally I wouldn't put anything application specific in the superclass
because the superclass is where you define the general solution and
subclasses is where you define the specific solution.

Having said that, you can really break your question into two possible
solutions that I personally could live with:

1) you could live with the resource management methods provided by the
webware servlet architecture (init(), sleep(), and awake() for example)

2) or you could engineer your own db connection pool and use that via
containment in your servlets.

In the architecture my team has built around webware we abstract all our
business logic out of the servlets themselves into a system of contained
classes that know how to manage what they need to get the job done.  I
also am lucky in that I have someone here to rely on to provide
application data layer access via some agreed upon apis and in most cases
she's provided me with an abstraction of my database objects that
effectively hides the db connections from me entirely.   This simplifies
the business logic extensively, allowing it to be focused upon higher
level decisions and logic.

The advantages of this are that I actually have a very small number of
servlets that are all built around the core ability to identify what is
being asked, find an object that can do that thing and marshalling that
object to do the thing for it.  The details of how it does that thing are
lost on the servlet.

I guess what I'm saying is that I'd find a way to bury db connection
pooling in the depths of your own architecture rather than relying on
webware to manage it for you.  But there's probably lots of arguments for
doing the first option too.

geeze, looking back up on my text here, I hope this helps in some way.
jeremy


> Uwe Grauer wrote:
>
>> Hi Experts,
>>
>> after getting a bit familar with WebKit i'm still confused on where to
>> store
>> Database Connections.
>> The idea is, to have a Pool of DbConns where a servlet will get a
>> Connection
>> on awake() and releases it again to the pool on sleep().
>> I can't think of opening the DB at every run of the servlet.
>> If the servlets are in different threads, i have to have one DbConn
>> for every
>> servlet (thread).
>>
>> So i think, DB-Conns should go into the Application.
>> But then, how do i get to the Application level of storage?
>> What about thread-locking to get variables, which are outside of the
>> thread?
>>
>> How are you people handling this?
>>
>> Any Pointers to Docs about this?
>>
>> Thanks for any help on this, since i still have no clue about this,
>>
>> Uwe
>>
> Is the superclass the place for application specific variables?
> If so, please explain a bit.
>
> Thanks,
>     Uwe
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Sybase ASE Linux Express Edition - download now for FREE
> LinuxWorld Reader's Choice Award Winner for best database on Linux.
> http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> _______________________________________________
> Webware-discuss mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
>



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to