I see that you have tried to "gut" away your actual app and renamed
the bits that you think creates a problem.
I also see a worrying pattern; You are storing all kinds of Qi4j
artifacts in the AbcApplication singleton. This is NOT allowed. Qi4j
insists on owning all those objects. Perhaps you think there is only
one QueryBuilderFactory? No. In fact, all those factories are now gone
in favor of Module, since it is in fact one of those per Module.
If I was on your team, I would disagree with the layering chosen as well.
Typically;
1. Interface layer (WS-*, ReST, RMI, ++)
2. Application layer (coordination/orchestration)
3. Domain layer (business logic)
4. Infrastructure
However, there are many reasons to deviate from that recommendation,
but it is a reasonable starting point.
Since you have taken away all the content in the layers, I can't
advice what belongs where and defeats the purpose...
So, if you instead follow the layering above, for ANY setup of
EntityStore and Indexing;
* Add the ConfigurationComposites of Indexing and the primary
EntityStore into a Module called "Configuration", which has another
EntityStore inside it (for instance the MemoryEntityStore) which
doesn't require configuration, and the ConfigurationComposites set to
Visibility.layer, BUT the Configuration module's ES is
Visibility.module.
* The EntityStore and Indexing you choose is likely to have an
Assembler defined. The documentation for the SQL ES is reasonable;
http://www.qi4j.org/extension-es-sql.html
but I think the SQL Indexing one is far from clear.
(Paul/Stanislav; can you make the context of the code sample a bit
more explicit)
http://www.qi4j.org/extension-indexing-sql.html
You don't have to use the Assemblers provided, but they are
intended to make your bootstrap code simpler.
Cheers
Niclas
On Sat, Oct 27, 2012 at 9:32 PM, Jiri Jetmar <[email protected]> wrote:
> Hi Niclas,
>
> https://dl.dropbox.com/u/11404177/com.smartnerds.qi4j.test.persistence.zip
>
> Thank you.
>
> Cheers,
> Jiri
>
> 2012/10/27 Niclas Hedhman <[email protected]>:
>> Can you upload your whole thing somewhere, so I can take a look at how
>> you have managed to get it wrong and where we can improve docs to
>> avoid this in the future...?
>>
>>
>>
>> On Sat, Oct 27, 2012 at 5:24 PM, Jiri Jetmar <[email protected]>
>> wrote:
>>> Hello guys,
>>>
>>> I tried to follow your advices and also added the Queryable(false) flag
>>> to org.qi4j.library.sql.common.SQLConfiguration.
>>>
>>> I adapted my assembly from the cargo_dcisample_b source code as I;m
>>> using this sample
>>> as a kind of "inspiration" for my own project.
>>>
>>> Attached there is a simple project where I was trying to solve the SQL
>>> Entity/Indexing
>>> issue. To keep it very simple I used the
>>>
>>> SQLTestHelper.assembleWithSQLEntityStore(indexingModule);
>>>
>>> statement found in the JUnit tests. Also played with the visibility flag
>>> in SQLTestHelper.doCommonAssembling() but either I received the
>>>
>>> 1.) org.qi4j.api.service.NoSuchServiceException: Could not find any
>>> visible ServiceComposite of type [org.qi4j.spi.query.EntityFinder]
>>> or
>>> 2.) java.lang.IllegalStateException: java.lang.StackOverflowError
>>>
>>> Sorry guys, I was not able to solve it by my self... :-(
>>>
>>> Cheers,
>>> Jiri
>>>
>>>
>>> 2012/10/27 Stanislav Muhametsin <[email protected]>:
>>>> Quoting Niclas Hedhman <[email protected]>:
>>>>
>>>>> Ok, Paul's description seem right.
>>>>>
>>>>> On Sat, Oct 27, 2012 at 1:28 AM, Paul Merlin <[email protected]> wrote:
>>>>>
>>>>>> Third, the endless loop seems to come from the DataSourceConfiguration
>>>>>> loading and to take place in EntityStore.newUnitOfWork(..) but at first
>>>>>> sight and without a complete test case I can't see why it goes crazy like
>>>>>> that.
>>>>>
>>>>>
>>>>> Well, my guess is that the Configuration for Indexing is Queryable.
>>>>>
>>>>> - initialize indexing
>>>>> - initialize config
>>>>> - send config for storage
>>>>> - config is queryable
>>>>> - notify indexing
>>>>> - initialize indexing
>>>>> - ....
>>>>>
>>>>
>>>> The configuration for SQL Indexing is same as for SQL EntityStore,
>>>> org.qi4j.library.sql.common.SQLConfiguration. I've pushed change to add
>>>> Queryable(false) attribute the the property of that configuration, tell me
>>>> if that helps.
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> qi4j-dev mailing list
>>>> [email protected]
>>>> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>>>
>>> _______________________________________________
>>> qi4j-dev mailing list
>>> [email protected]
>>> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>>>
>>
>>
>>
>> --
>> Niclas Hedhman, Software Developer
>> 河南南路555弄15号1901室。
>> http://www.qi4j.org - New Energy for Java
>>
>> I live here; http://tinyurl.com/3xugrbk
>> I work here; http://tinyurl.com/6a2pl4j
>> I relax here; http://tinyurl.com/2cgsug
>>
>> _______________________________________________
>> qi4j-dev mailing list
>> [email protected]
>> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>
> _______________________________________________
> qi4j-dev mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
--
Niclas Hedhman, Software Developer
河南南路555弄15号1901室。
http://www.qi4j.org - New Energy for Java
I live here; http://tinyurl.com/3xugrbk
I work here; http://tinyurl.com/6a2pl4j
I relax here; http://tinyurl.com/2cgsug
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev