The last time there was a problem with CreateIfNoSchemaStrategy, it was 
actually strategy being too eager not detecting the existing schema on the 
following runs:

 http://markmail.org/message/7cr4dksbv2foglsm

So the strategy definitely should be invoked on startup. But it can fail for a 
variety of reasons (such as insufficient DB permissions, or the wrong default 
schema, etc.) There should be some info in the logs pointing to the cause.

Andrus


On Feb 20, 2011, at 5:38 PM, Christian Grobmeier wrote:

> Actually i have made the same experience. It worked 1 time, then never
> again. But I didn't track it, I used the migration tool in the
> modeller.
> 
> On Sun, Feb 20, 2011 at 4:32 PM, Andrus Adamchik <and...@objectstyle.org> 
> wrote:
>> Odd. Configuration seems correct. So what do you see in the logs when 
>> Cayenne starts in your application?
>> 
>> Andrus
>> 
>> On Feb 20, 2011, at 4:48 PM, Thorben Wallmeyer wrote:
>> 
>>> Hi everyone,
>>> 
>>> I'm working with Cayenne and I'm trying to automatically create a schema 
>>> when cayenne connects for the first time the the configured databse. 
>>> Therefore I've slighty changed my cayenne.xml file, so that it looks like:
>>> 
>>> <node name="MeTexNode"
>>>         datasource="module/storage/MeTexNode.driver.xml"
>>>         factory="org.apache.cayenne.conf.DriverDataSourceFactory"
>>>         
>>> schema-update-strategy="org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy">
>>> <map-ref name="MeTexORM"/>
>>> </node>
>>> 
>>> 
>>> So, I've added the attribute "schema-update-strategy" but nothing happens - 
>>> no tables are generated. So what I'm doing wrong? Can you send me a simple, 
>>> working example?
>>> 
>>> Best,
>>> 
>>> Thorben
>> 
>> 
> 
> 
> 
> -- 
> http://www.grobmeier.de
> 

Reply via email to