I don't know if this will always be the case, but 3.0 (in
WebApplicationContextFilter and ServletUtil) creates a DataContext:
DataContext ctxt = (DataContext)
session.getAttribute(DATA_CONTEXT_KEY);
if (ctxt == null) {
ctxt = DataContext.createDataContext()
Thanks guys. Will it always be safe to cast
BaseContext.getThreadObjectContext() to DataContext?
-Mike
From:
Michael Gentry
To:
user@cayenne.apache.org
Date:
04/05/2010 04:46 PM
Subject:
Re: jdbc connection
dataContext.getParentDataDomain().getNode("foo").getDataSource().getConnection()
dataContext.getParentDataDomain().getNode("foo").getDataSource().getConnection()
returns the Connection, I think. Replace "foo" with the name of your
DataNode.
mrg
On Mon, Apr 5, 2010 at 4:26 PM, wrote:
> What's the best way to get a direct handle to a jdbc connection in your
> underlying pool
something like DataContext.getParentDataDomain().getDataNode(name). You're
right, this is a way to obtain a connection
2010/4/6
> What's the best way to get a direct handle to a jdbc connection in your
> underlying pool. It looked like getting it straight from DataNode was the
> way to go, but
What's the best way to get a direct handle to a jdbc connection in your
underlying pool. It looked like getting it straight from DataNode was the
way to go, but then how do I get to my DataNode? :) Thanks.
-Mike
Cayenne 3.0 Release Candidate 3 is available for download now [1]. It
has a number of bug fixes [2] and is hopefully the last release before
3.0 final. Please download it and try it out.
Cheers,
Andrus
[1] http://cayenne.apache.org/download.html
[2]
http://svn.apache.org/repos/asf/cay