complex: Inheritance, batch faulting, and database channels (was Re: no database channel?)

Jonathan Rochkind <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel,gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Okay, I've figured out exactly what is causing my problem, but I still 
don't understand what's going on or if it's my bug or Apple's. It involves 
the "batch faulting size" set in EOModeler, a feature I have used 
extensively in the past and never had a problem; it's a great feature to 
easily reduce db roundtrips.

But I don't understand how to use it properly with inheritance. Here is my 
object graph (names of entities and relationships changed to make it easier 
to understand).

1) Abstract root entity Person
         Sub-entity Customer
         Sub-entity Employee
         [Single-table inheritance is used]

2) Person has a relationship "pets" to Entity "Pet".  This relationship is 
of course inherited by Customer and Employee.

Some other entities have relationships defined to Person, but others have 
relationships defined specifically to a sub-entity.  This works fine, 
generally.

But now we get to the batch faulting size.  By default, this is 0, but I'd 
like to change it. If I give abstract entity Person a non-zero batch 
faulting size, then when I fetch a Customer or Employee's "pets" 
relationship, I get a "no database channel available" exception. I am 
guessing this has to do with the backpointing relationship in Pet to 
Person---all these faults are somehow getting tripped as a batch, and the 
inheritance involved is giving me my exception.

Is this a bug that I should report?

If I leave Person with a batch faulting size of 0, but set both Employee 
and Customer to have a non-zero size, then I get no exception. But I'm not 
sure I'm going to get automatic batch faulting behavior involving to-one 
relationships to the abstract Person. But I want this behavior.

Can anyone explain what's going on, and what I should do? Do I need a 
database channel for each sub-entity? Or just two database channels 
regardless of number of sub-entities?  And why? Is this a bug?  Any 
guidance would be great.

--Jonathan

At 01:18 PM 10/9/2002 -0500, Jonathan Rochkind wrote:
>After making no major changes to my application that I am aware of, one 
>particular page suddenly gives me the following exception in appendToResponse:
>
>Error: java.lang.IllegalStateException Reason: _obtainOpenChannel -- 
>com.webobjects.eoaccess.EODatabaseContext 
>com.webobjects.eoaccess.EODatabaseContext@3754b2: no database channel is 
>available
>
>
>Any ideas?
>
>_______________________________________________
>EOF mailing list
>[email protected]
>http://www.omnigroup.com/mailman/listinfo/eof
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.