You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Tim T. Young" <Yo...@cat.com> on 2002/09/06 18:55:32 UTC

RE: [Share DB Connections] how to return errors from Model component

Database connections (ie jdbc) are usually done through connection manager
classes or container managed data sources.  Our infrastructure provides a
PoolManager which does db, ldap, custom, etc pooling.  When we want a
connection we just "PoolManager.getCurrent().getConnection(...).  The
connections are pooled behind the scenes, improving effeciency, etc.  Of
course when I hear "model" I think totally independent classes which could
be reused in any jvm, so I probably would have some type of persistance
manager class asking for the connections to do the persistance work on the
model object.

Tim



                                                                                                                                               
                    "Kenny Smith"                                                                                                              
                    <kenny@journal                                                                                                             
                    scape.com>                                                                                                                 
                                                                                                                                               
                    09/06/2002                                                                                                                 
                    11:32 AM       To: "Struts Users Mailing List" <st...@jakarta.apache.org>                                            
                    Please respond cc:                                                                                                         
                    to "Struts                                                                                                                 
                    Users Mailing                                                                                                              
                    List"                                                                                                                      
                                          Subject:     RE: how to return errors from Model component                                           
                                                                                                                                               



Caterpillar: Confidential Green          Retain Until: 10/06/2002
                                         Retention Category:  G90 -
                                         Information and Reports




Hi,

> Someone on the list once said that the Model should
> not know its in a web app...

I totally agree with this statement, but I've been having real problems
keeping the Model from knowing it's a webapp and still being able to
properly share a database connection. I'm still a beginner to java and
struts, so there may be a simple answer I'm missing but...

How do you guys and gals get your model objects to share your database
connections without letting them know they are a web app?

Kenny Smith
JournalScape.com


--
To unsubscribe, e-mail:   <
mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:struts-user-help@jakarta.apache.org>






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>