Well, I canot provide you with examples for best practise, but let me
try to answer some of your questions. Please see below ...

Werner

On Sat, 11 Jan 2003 16:29:03 -0500, tek1 wrote:

> hello.
> 
> are there any best practices and/or samples available for using castor in 
> 1) servlet-only environment, and 2) application server (jboss) environment? 
> i have scoured the mailing list archive and found general suggestions, but 
> wondering if there any concrete examples, which would help in the adoption 
> of castor.
> 
> i came across:
> http://castor.exolab.org/list-archive/msg21979.html
> which seems to be a good example for a servlet environment.
> 
> one question regarding the above example and castor usage in a servlet 
> environment in general though, does a new Database object need to be 
> obtained for each method (or call from a servlet)?  from what i've read, 
> the Database object is not thread-safe, so the previously described seems 
> to be the correct approach, but would like confirmation.
Yes, indeed. I've been working on a project where we deployed Castor as
part of a web application on Tomcat/ServletExec 4.1/Websphere 4.0, and
you'll have to get a fresh Database instance for each thread.

> 
> in a servlet environment, if obtaining a new Database object for each 
> method (or call from a servlet) is the correct approach, how does this 
> impact performance since it seems that 1 Database object = 1 database 
> connection.  if that is the case, should a pool of Database objects be used 
> in such an environment?  if so, are there any existing projects (i.e. 
> jakarta commons) that offer such pooling ability?
Why not rely on the pooling mechanism of your container, i.e. jboss in
your case. Just setup and configure a JDBC connection pool, and make it
available to Castor b ytelling Castor to obtain JDBC connections from a
specified enrty in a JNDI naming tree ? That way, the overhead
associated to obtaining fresh Database instances for each thread should
be minimal.

> 
> for application server environments, in particular jboss, is there a 
> concrete example of what needs to be done:
> 
>       1) one's one castor-based application, and
>       2) jboss' configuration
> 
> any suggestions and advice would be greatly appreciated.
> 
> it would be a big help for newbies if some type of simple "howto-servlet" 
> and "howto-jboss" explanations were put up on the castor website.
> 
> thank you.
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to