Graham Stark wrote:
> Could someone explain all this to me? Obviously, I can configure
> connection pools manually outside of the Struts framework, but I
> assume there are advantages in doing so in a Struts-centric way if
> you can, andthe DBCP implementation looks quite nice, if I could only > get it to work.


There really are not any worthwhile advantages to handling the datasources from within Struts. The preferred way is to have your business layer take care of the datasources on its own, without Struts being involved at all.

At this date, the only time that the Struts datasource gizmo would be helpful would be if you had a pre-existing business layer that couldn't acquire its own connections, and were using a container that did not supply a datasource of its own. But configurations like that are *very* few and far between these days.

If you are starting from scratch, then I would strongly recommend *not* using the datasource manager. The datasource manager was a Good Thing three years ago, but, at this point, has outlived its usefulness in most environments.

If you needed to manage several different datasource implementations and wanted to switch between them, the datasource manager might be useful. But in that regard, it would be much more useful if it were not coupled to Struts and available through the Commons. Which, ultimately, is probably what will happen.

-Ted.


Hi,
   apologies if this is an obvious question, but I can't work it out.

If you're trying to configure a datasource in Struts 1.1, what's the
preferred method?


The only way I've got this work using the struts-config file is if I force the data source to be org.apache.struts.util.GenericDataSource,
as in:


<data-source key="horizon" type="org.apache.struts.util.GenericDataSource">
[..]
</data-source>


None of the pooling methods from, for example, the
org.apache.commons.dbcp package seem to work at all.


Looking at the source code (around line 1080 in
org.apache.struts.action.ActionServlet.java), this seems to be
deliberate.

Could someone explain all this to me? Obviously, I can configure
connection pools manually outside of the Struts framework, but I assume
there are advantages in doing so in a Struts-centric way if you can, and
the DBCP implementation looks quite nice, if I could only get it to
work.

I'd be grateful for any guidance anyone had on this.

thanks,

Graham




-- Ted Husted, Junit in Action - <http://www.manning.com/massol/>, Struts in Action - <http://husted.com/struts/book.html>, JSP Site Design - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to