On Wed, Dec 8, 2010 at 10:25 AM, Rickard Öberg <[email protected]> wrote:
> The trick is to let your initial data bootstrap work with known Entity id's,
> rather than doing queries. In my case I have a known Users entity, with a
> given id, that I check for:
> try
> {
> // Check if users entity exists
> users = uow.get( UsersEntity.class, UsersEntity.USERS_ID );
> } catch (NoSuchEntityException e)
> {
> // Create bootstrap data
> users = uow.newEntity( UsersEntity.class, UsersEntity.USERS_ID );
> }
That doesn't solve the "Re-index" issue, does it?
I think that the observation "more explicitly" is probably a good one.
Another thing we could consider is supporting "isAvailable()" for the
EntityFinder, which goes false during Re-indexing, and have that
checked either directly by client code, and toss an Exception at
query.iterator()...
Cheers
--
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java
I live here; http://tinyurl.com/2qq9er
I work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev