FWIW, I did manage to figure this out. Basically, I was trying to use the connection for my own purposes (to initialize the schema) before Cayenne got ahold of it, which was causing it to be in an invalid state when Cayenne tried to use it.
The solution was to replace my wrapper with a PoolManager, which I figured out by copying DriverDataSourceFactory.java, and making sure to close() the connection after I was done with my initialization block. -----Original Message----- From: Andrus Adamchik [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2008 12:43 PM To: [email protected] Subject: Re: How can I customize the driver/url/login > I'm using a custom DataSourceFactory now; So how does this code look like? There's something in the DataSource it returns that results in the errors you've mentioned. Andrus On Apr 3, 2008, at 7:18 PM, Scott Anderson wrote: > I'm using a custom DataSourceFactory now; if I switch it back to > DriverDataSourceFactory and set the minimum connections to 2, Derby > complains about how there can't be two connections, as I'm using the > EmbeddedDriver. > > -----Original Message----- > From: Michael Gentry [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 03, 2008 12:01 PM > To: [email protected] > Subject: Re: How can I customize the driver/url/login > > Just for kicks, bump up your minimum DB connections in the modeler and > see what happens ... > > > On Thu, Apr 3, 2008 at 11:37 AM, Scott Anderson > <[EMAIL PROTECTED]> > wrote: >> While I know enough to briefly describe what a connection pool is, I >> have no idea how Cayenne uses it, or how it's configured. Could you > go >> in to a little more detail? AFAIK, I'm using what ever the default >> settings are. >> >> It seems unlikely to me that it's derby related because when I use > the >> modeler to specify the database location, I don't see anything like >> this. Could it be that the adapter isn't being specified? I noticed > that >> Cayenne is warning that it's using the "automatic" one. >> >> Apr 3, 2008 11:33:56 AM org.apache.cayenne.conf.RuntimeLoadDelegate >> initAdapter >> INFO: no adapter set, using automatic adapter. >
