You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Watkins, Garry" <gw...@motleyrice.com> on 2006/05/17 04:44:53 UTC

DataNode getDataSource()

Andrus,

I have successfully gotten the EOModel to load from within WebObjects,
however, I am having a difficult time figuring out how to associate a data
source with the DataNode.

I am able to get all of the information from the eomodel to set up a
DataSourceInformation object.  If it is a standard JDBC connection, how do I
get Cayenne to use the DSI at run time to generate a connection?  I guess a
better question is, shouldn't the DataNode.getDataSource() method use the
dataSourceFactory and the DSI to create a dataSource at run time if the
dataSource is null?

Any guidance that you can give me would be appreciated.

Thanks
Garry







Confidential & Privileged

Unless otherwise indicated or obvious from its nature, the information contained in this communication is attorney-client privileged and confidential information/work product. This communication is intended for the use of the individual or entity named above.  If the reader of this communication is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.  If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies--electronic, paper or otherwise--which you may have of this communication.




Re: DataNode getDataSource()

Posted by Andrus Adamchik <an...@objectstyle.org>.
While DataNode stores 'dataSourceFactory' name for historical  
reasons, it never actually uses it. So you have to create and set a  
DataSource instance on your own.  
"org.objectstyle.cayenne.conn.PoolManager" is a convenience  
implementation that you can use.

Andrus


On May 16, 2006, at 10:44 PM, Watkins, Garry wrote:

> Andrus,
>
> I have successfully gotten the EOModel to load from within WebObjects,
> however, I am having a difficult time figuring out how to associate  
> a data
> source with the DataNode.
>
> I am able to get all of the information from the eomodel to set up a
> DataSourceInformation object.  If it is a standard JDBC connection,  
> how do I
> get Cayenne to use the DSI at run time to generate a connection?  I  
> guess a
> better question is, shouldn't the DataNode.getDataSource() method  
> use the
> dataSourceFactory and the DSI to create a dataSource at run time if  
> the
> dataSource is null?
>
> Any guidance that you can give me would be appreciated.
>
> Thanks
> Garry