You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Joe Baldwin <jf...@earthlink.net> on 2010/03/29 18:32:51 UTC

Cayenne Modeler - Local DataSources

I am having a problem with Cayenne Modeler - Edit Preferences - Local DataSources.

I am working with three projects right now and have created three separate project directories.  I am using Cayenne Modeler to manage the datasource design.  Unfortunately when I move from one project to another the Preferences do not seem to maintain integrity.

For example the Local DataSources from the first project continues to show up for the third project and the new datasources do not show up.   Now, it might seem logical that the DataSources be maintained separately from the project and CM might be doing this, however when I add a new datasource, and save it, it reverts back to the old set of datasources.

The selected datasource does not appear to be saved between projects, and if I add a new one, it does not appear to save it.  (Yes, I did select the "Save" button at the bottom of the "Local Datasources" pane.

So, my questions are:

1. is the datasource list kept in a separate configuration by CM?
2. How do I manage the DataSource list so that the new datasource is saved?
3. How do I manage the project so I can control which datasource selection.

Thanks,
Joe


Re: Cayenne Modeler - Local DataSources

Posted by Michael Gentry <mg...@masslight.net>.
I did 1.a ... after I got the preferences restored/working, I set up
everything the way I wanted and then did a backup in Time Machine so
I'd have a working version again if I had to restore.

For 3.1, we'll be switching over to the Java Preferences API instead
of XML files.

mrg


On Mon, Mar 29, 2010 at 1:07 PM, Joe Baldwin <jf...@earthlink.net> wrote:
> Michael,
>
> Thanks, I think I remember this being a previous problem.  So I just deleted the entire ".cayenne" directory, and now it saves the datasource configuration correctly (well at least for this one project).  Thanks.
>
> So, my next question is:
>
> 1. Until 3.1 re-design, what steps should I now take wrt the ".cayenne" dir to ensure that my datasources are all available for all 3 of my projects?
>        a. do I need to re-create all of my datasources and then save
>        b. if I do step "a." then do I need to do anything else for the other projects or is the "re-create" step sufficient.
>
> Thanks,
> Joe
>
> PS I would have thought that you would have used the XML pattern as a solution for the CM-level preferences as you did with the project files.  (Your project files are pretty much bullet-proof, and I can even make quick changes using direct text-editing.  IMHO this is an excellent design.)
>
>
>
>
>
> On Mar 29, 2010, at 12:43 PM, Michael Gentry wrote:
>
>> You are probably running into a known issue CM has with HypersonicSQL
>> (the embedded database Cayenne uses to save preferences -- an "eat
>> your own dogfood" kind of thing).  Unfortunately, the simplest thing
>> to do is delete the preferences DB and start over.  If you look in
>> your ~/.cayenne/prefs/1.2 directory, you'll probably see multiple DB
>> files instead of just one and somehow HSQL is using the wrong one.  If
>> you are on a Mac and use Time Machine, it is possible to go back and
>> find a working DB and restore it, but still painful.
>>
>> Cayenne 3.1 is scrapping HSQL, but that probably doesn't help you ...
>>
>> mrg
>>
>>
>> On Mon, Mar 29, 2010 at 12:32 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>> I am having a problem with Cayenne Modeler - Edit Preferences - Local DataSources.
>>>
>>> I am working with three projects right now and have created three separate project directories.  I am using Cayenne Modeler to manage the datasource design.  Unfortunately when I move from one project to another the Preferences do not seem to maintain integrity.
>>>
>>> For example the Local DataSources from the first project continues to show up for the third project and the new datasources do not show up.   Now, it might seem logical that the DataSources be maintained separately from the project and CM might be doing this, however when I add a new datasource, and save it, it reverts back to the old set of datasources.
>>>
>>> The selected datasource does not appear to be saved between projects, and if I add a new one, it does not appear to save it.  (Yes, I did select the "Save" button at the bottom of the "Local Datasources" pane.
>>>
>>> So, my questions are:
>>>
>>> 1. is the datasource list kept in a separate configuration by CM?
>>> 2. How do I manage the DataSource list so that the new datasource is saved?
>>> 3. How do I manage the project so I can control which datasource selection.
>>>
>>> Thanks,
>>> Joe
>>>
>>>
>
>

Re: Cayenne Modeler - Local DataSources

Posted by Joe Baldwin <jf...@earthlink.net>.
Michael,

Thanks, I think I remember this being a previous problem.  So I just deleted the entire ".cayenne" directory, and now it saves the datasource configuration correctly (well at least for this one project).  Thanks.

So, my next question is: 

1. Until 3.1 re-design, what steps should I now take wrt the ".cayenne" dir to ensure that my datasources are all available for all 3 of my projects?
	a. do I need to re-create all of my datasources and then save
	b. if I do step "a." then do I need to do anything else for the other projects or is the "re-create" step sufficient.

Thanks,
Joe

PS I would have thought that you would have used the XML pattern as a solution for the CM-level preferences as you did with the project files.  (Your project files are pretty much bullet-proof, and I can even make quick changes using direct text-editing.  IMHO this is an excellent design.)





On Mar 29, 2010, at 12:43 PM, Michael Gentry wrote:

> You are probably running into a known issue CM has with HypersonicSQL
> (the embedded database Cayenne uses to save preferences -- an "eat
> your own dogfood" kind of thing).  Unfortunately, the simplest thing
> to do is delete the preferences DB and start over.  If you look in
> your ~/.cayenne/prefs/1.2 directory, you'll probably see multiple DB
> files instead of just one and somehow HSQL is using the wrong one.  If
> you are on a Mac and use Time Machine, it is possible to go back and
> find a working DB and restore it, but still painful.
> 
> Cayenne 3.1 is scrapping HSQL, but that probably doesn't help you ...
> 
> mrg
> 
> 
> On Mon, Mar 29, 2010 at 12:32 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>> I am having a problem with Cayenne Modeler - Edit Preferences - Local DataSources.
>> 
>> I am working with three projects right now and have created three separate project directories.  I am using Cayenne Modeler to manage the datasource design.  Unfortunately when I move from one project to another the Preferences do not seem to maintain integrity.
>> 
>> For example the Local DataSources from the first project continues to show up for the third project and the new datasources do not show up.   Now, it might seem logical that the DataSources be maintained separately from the project and CM might be doing this, however when I add a new datasource, and save it, it reverts back to the old set of datasources.
>> 
>> The selected datasource does not appear to be saved between projects, and if I add a new one, it does not appear to save it.  (Yes, I did select the "Save" button at the bottom of the "Local Datasources" pane.
>> 
>> So, my questions are:
>> 
>> 1. is the datasource list kept in a separate configuration by CM?
>> 2. How do I manage the DataSource list so that the new datasource is saved?
>> 3. How do I manage the project so I can control which datasource selection.
>> 
>> Thanks,
>> Joe
>> 
>> 


Re: Cayenne Modeler - Local DataSources

Posted by Andrus Adamchik <an...@objectstyle.org>.
No I am talking about the "output directory" preference only.

Entity selections within a DataMap should work as before and are not  
preferences driven.

Andrus

On Mar 29, 2010, at 10:09 PM, Joe Baldwin wrote:

> Andrus,
>
> I seem to recall that CM used to generate code based on what was  
> selected (I may be wrong, but that is what I remember).  So that if  
> you had just one entity selected in a datamap, that was all that was  
> getting updated.
>
> But then I think that behavior might have changed.   Either way I  
> usually select the intended datamap with the intention that *all* of  
> that map's entities will be generated and the database tables will  
> be generated.
>
> Is this what you are referring to?
>
> Joe
>
>
>
>
> On Mar 29, 2010, at 2:59 PM, Andrus Adamchik wrote:
>
>> I just tried, starting with blank preferences and RC3 modeler.  
>> Initial (default) class generation output directories were  
>> different for different projects (guessed correctly based on the  
>> Maven project structure). Custom changes to those were stored and  
>> reloaded from preferences after a restart.
>>
>> I should mention though that these are stored not only per project,  
>> but also per DataMap within a project, so if you have more than one  
>> DataMap, customizations have to be applied to each one of the maps,  
>> otherwise Cayenne would suggest a default location.
>>
>> Also don't remember the default behavior for non-maven project  
>> structures, but that should not affect preferences behavior.
>>
>> Andrus
>>
>> On Mar 29, 2010, at 9:08 PM, Michael Gentry wrote:
>>
>>> Hmm, I just tried this with RC3 and it definitely changed my default
>>> output folder.  I had project A open with project A's output folder
>>> selected.  Then I switched to project B and it selected project A's
>>> output folder.  I'm not sure if this behavior has always existed  
>>> or if
>>> it is a new bug.
>>>
>>> mrg
>>>
>>>
>>> On Mon, Mar 29, 2010 at 1:20 PM, Joe Baldwin <jfbaldwin@earthlink.net 
>>> > wrote:
>>>> Michael,
>>>>
>>>> It appears that the "Code Generation - Output Directory" is  
>>>> having the same problem (i.e. it would revert to a previous  
>>>> directory after I changed it).
>>>>
>>>> Is this another issue having to do with the ".cayenne" directory?
>>>>
>>>> thanks,
>>>> Joe
>>>>
>>>>
>>>
>>
>
>


Re: Cayenne Modeler - Local DataSources

Posted by Joe Baldwin <jf...@earthlink.net>.
Andrus,

I seem to recall that CM used to generate code based on what was selected (I may be wrong, but that is what I remember).  So that if you had just one entity selected in a datamap, that was all that was getting updated.

But then I think that behavior might have changed.   Either way I usually select the intended datamap with the intention that *all* of that map's entities will be generated and the database tables will be generated.

Is this what you are referring to?

Joe




On Mar 29, 2010, at 2:59 PM, Andrus Adamchik wrote:

> I just tried, starting with blank preferences and RC3 modeler. Initial (default) class generation output directories were different for different projects (guessed correctly based on the Maven project structure). Custom changes to those were stored and reloaded from preferences after a restart.
> 
> I should mention though that these are stored not only per project, but also per DataMap within a project, so if you have more than one DataMap, customizations have to be applied to each one of the maps, otherwise Cayenne would suggest a default location.
> 
> Also don't remember the default behavior for non-maven project structures, but that should not affect preferences behavior.
> 
> Andrus
> 
> On Mar 29, 2010, at 9:08 PM, Michael Gentry wrote:
> 
>> Hmm, I just tried this with RC3 and it definitely changed my default
>> output folder.  I had project A open with project A's output folder
>> selected.  Then I switched to project B and it selected project A's
>> output folder.  I'm not sure if this behavior has always existed or if
>> it is a new bug.
>> 
>> mrg
>> 
>> 
>> On Mon, Mar 29, 2010 at 1:20 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>> Michael,
>>> 
>>> It appears that the "Code Generation - Output Directory" is having the same problem (i.e. it would revert to a previous directory after I changed it).
>>> 
>>> Is this another issue having to do with the ".cayenne" directory?
>>> 
>>> thanks,
>>> Joe
>>> 
>>> 
>> 
> 


Re: Cayenne Modeler - Local DataSources

Posted by Andrus Adamchik <an...@objectstyle.org>.
I just tried, starting with blank preferences and RC3 modeler. Initial  
(default) class generation output directories were different for  
different projects (guessed correctly based on the Maven project  
structure). Custom changes to those were stored and reloaded from  
preferences after a restart.

I should mention though that these are stored not only per project,  
but also per DataMap within a project, so if you have more than one  
DataMap, customizations have to be applied to each one of the maps,  
otherwise Cayenne would suggest a default location.

Also don't remember the default behavior for non-maven project  
structures, but that should not affect preferences behavior.

Andrus

On Mar 29, 2010, at 9:08 PM, Michael Gentry wrote:

> Hmm, I just tried this with RC3 and it definitely changed my default
> output folder.  I had project A open with project A's output folder
> selected.  Then I switched to project B and it selected project A's
> output folder.  I'm not sure if this behavior has always existed or if
> it is a new bug.
>
> mrg
>
>
> On Mon, Mar 29, 2010 at 1:20 PM, Joe Baldwin  
> <jf...@earthlink.net> wrote:
>> Michael,
>>
>> It appears that the "Code Generation - Output Directory" is having  
>> the same problem (i.e. it would revert to a previous directory  
>> after I changed it).
>>
>> Is this another issue having to do with the ".cayenne" directory?
>>
>> thanks,
>> Joe
>>
>>
>


Re: Cayenne Modeler - Local DataSources

Posted by Michael Gentry <mg...@masslight.net>.
Hmm, I just tried this with RC3 and it definitely changed my default
output folder.  I had project A open with project A's output folder
selected.  Then I switched to project B and it selected project A's
output folder.  I'm not sure if this behavior has always existed or if
it is a new bug.

mrg


On Mon, Mar 29, 2010 at 1:20 PM, Joe Baldwin <jf...@earthlink.net> wrote:
> Michael,
>
> It appears that the "Code Generation - Output Directory" is having the same problem (i.e. it would revert to a previous directory after I changed it).
>
> Is this another issue having to do with the ".cayenne" directory?
>
> thanks,
> Joe
>
>

Re: Cayenne Modeler - Local DataSources

Posted by Joe Baldwin <jf...@earthlink.net>.
Michael,

It appears that the "Code Generation - Output Directory" is having the same problem (i.e. it would revert to a previous directory after I changed it).

Is this another issue having to do with the ".cayenne" directory?

thanks,
Joe


Re: Cayenne Modeler - Local DataSources

Posted by Michael Gentry <mg...@masslight.net>.
You are probably running into a known issue CM has with HypersonicSQL
(the embedded database Cayenne uses to save preferences -- an "eat
your own dogfood" kind of thing).  Unfortunately, the simplest thing
to do is delete the preferences DB and start over.  If you look in
your ~/.cayenne/prefs/1.2 directory, you'll probably see multiple DB
files instead of just one and somehow HSQL is using the wrong one.  If
you are on a Mac and use Time Machine, it is possible to go back and
find a working DB and restore it, but still painful.

Cayenne 3.1 is scrapping HSQL, but that probably doesn't help you ...

mrg


On Mon, Mar 29, 2010 at 12:32 PM, Joe Baldwin <jf...@earthlink.net> wrote:
> I am having a problem with Cayenne Modeler - Edit Preferences - Local DataSources.
>
> I am working with three projects right now and have created three separate project directories.  I am using Cayenne Modeler to manage the datasource design.  Unfortunately when I move from one project to another the Preferences do not seem to maintain integrity.
>
> For example the Local DataSources from the first project continues to show up for the third project and the new datasources do not show up.   Now, it might seem logical that the DataSources be maintained separately from the project and CM might be doing this, however when I add a new datasource, and save it, it reverts back to the old set of datasources.
>
> The selected datasource does not appear to be saved between projects, and if I add a new one, it does not appear to save it.  (Yes, I did select the "Save" button at the bottom of the "Local Datasources" pane.
>
> So, my questions are:
>
> 1. is the datasource list kept in a separate configuration by CM?
> 2. How do I manage the DataSource list so that the new datasource is saved?
> 3. How do I manage the project so I can control which datasource selection.
>
> Thanks,
> Joe
>
>

Re: Cayenne Modeler - Local DataSources

Posted by Joe Baldwin <jf...@earthlink.net>.
John,

I have been using Cayenne for a few years now, and have had to delete this ".cayenne" directory a few times.  I guess I assumed that Cayenne 3.X addressed this.

Thanks,
Joe



On Mar 29, 2010, at 12:44 PM, John Armstrong wrote:

> I see this as well.
> 
> I also saw this behavior in some of the early M-series and think it had to
> do with preference corruption or old vs new style prefs?
> 
> John-
> 
> On Mon, Mar 29, 2010 at 9:42 AM, Joe Baldwin <jf...@earthlink.net>wrote:
> 
>> More info:
>> 
>> Cayenne Version: cayenne-3.0RC2
>> OS: OSX
>> CM: OSX
>> 
>> I just did a test:
>> 
>> From Local Datasources pane,
>> 1. select "New"
>> 2. fill in the fields
>> 3. select "Test" (it was successful),
>> 4. select "Save".
>> 5. Close CM
>> 6. Re-open project using CM
>> 7. view Local Datasources
>>       - the new datasource is not in the list
>>       - the datasource for the wrong project has been substituted
>> 
>> This does not appear to be correct or intuitive behavior for CM.  Have I
>> missed a step?
>> 
>> 
>> 
>> 
>> 
>> 
>> On Mar 29, 2010, at 12:32 PM, Joe Baldwin wrote:
>> 
>>> I am having a problem with Cayenne Modeler - Edit Preferences - Local
>> DataSources.
>>> 
>>> I am working with three projects right now and have created three
>> separate project directories.  I am using Cayenne Modeler to manage the
>> datasource design.  Unfortunately when I move from one project to another
>> the Preferences do not seem to maintain integrity.
>>> 
>>> For example the Local DataSources from the first project continues to
>> show up for the third project and the new datasources do not show up.   Now,
>> it might seem logical that the DataSources be maintained separately from the
>> project and CM might be doing this, however when I add a new datasource, and
>> save it, it reverts back to the old set of datasources.
>>> 
>>> The selected datasource does not appear to be saved between projects, and
>> if I add a new one, it does not appear to save it.  (Yes, I did select the
>> "Save" button at the bottom of the "Local Datasources" pane.
>>> 
>>> So, my questions are:
>>> 
>>> 1. is the datasource list kept in a separate configuration by CM?
>>> 2. How do I manage the DataSource list so that the new datasource is
>> saved?
>>> 3. How do I manage the project so I can control which datasource
>> selection.
>>> 
>>> Thanks,
>>> Joe
>>> 
>> 
>> 


Re: Cayenne Modeler - Local DataSources

Posted by John Armstrong <si...@gmail.com>.
I see this as well.

I also saw this behavior in some of the early M-series and think it had to
do with preference corruption or old vs new style prefs?

John-

On Mon, Mar 29, 2010 at 9:42 AM, Joe Baldwin <jf...@earthlink.net>wrote:

> More info:
>
> Cayenne Version: cayenne-3.0RC2
> OS: OSX
> CM: OSX
>
> I just did a test:
>
> From Local Datasources pane,
> 1. select "New"
> 2. fill in the fields
> 3. select "Test" (it was successful),
> 4. select "Save".
> 5. Close CM
> 6. Re-open project using CM
> 7. view Local Datasources
>        - the new datasource is not in the list
>        - the datasource for the wrong project has been substituted
>
> This does not appear to be correct or intuitive behavior for CM.  Have I
> missed a step?
>
>
>
>
>
>
> On Mar 29, 2010, at 12:32 PM, Joe Baldwin wrote:
>
> > I am having a problem with Cayenne Modeler - Edit Preferences - Local
> DataSources.
> >
> > I am working with three projects right now and have created three
> separate project directories.  I am using Cayenne Modeler to manage the
> datasource design.  Unfortunately when I move from one project to another
> the Preferences do not seem to maintain integrity.
> >
> > For example the Local DataSources from the first project continues to
> show up for the third project and the new datasources do not show up.   Now,
> it might seem logical that the DataSources be maintained separately from the
> project and CM might be doing this, however when I add a new datasource, and
> save it, it reverts back to the old set of datasources.
> >
> > The selected datasource does not appear to be saved between projects, and
> if I add a new one, it does not appear to save it.  (Yes, I did select the
> "Save" button at the bottom of the "Local Datasources" pane.
> >
> > So, my questions are:
> >
> > 1. is the datasource list kept in a separate configuration by CM?
> > 2. How do I manage the DataSource list so that the new datasource is
> saved?
> > 3. How do I manage the project so I can control which datasource
> selection.
> >
> > Thanks,
> > Joe
> >
>
>

Re: Cayenne Modeler - Local DataSources

Posted by Joe Baldwin <jf...@earthlink.net>.
More info:

Cayenne Version: cayenne-3.0RC2
OS: OSX
CM: OSX

I just did a test:

From Local Datasources pane, 
1. select "New"
2. fill in the fields
3. select "Test" (it was successful), 
4. select "Save".  
5. Close CM
6. Re-open project using CM
7. view Local Datasources
	- the new datasource is not in the list
	- the datasource for the wrong project has been substituted

This does not appear to be correct or intuitive behavior for CM.  Have I missed a step?






On Mar 29, 2010, at 12:32 PM, Joe Baldwin wrote:

> I am having a problem with Cayenne Modeler - Edit Preferences - Local DataSources.
> 
> I am working with three projects right now and have created three separate project directories.  I am using Cayenne Modeler to manage the datasource design.  Unfortunately when I move from one project to another the Preferences do not seem to maintain integrity.
> 
> For example the Local DataSources from the first project continues to show up for the third project and the new datasources do not show up.   Now, it might seem logical that the DataSources be maintained separately from the project and CM might be doing this, however when I add a new datasource, and save it, it reverts back to the old set of datasources.
> 
> The selected datasource does not appear to be saved between projects, and if I add a new one, it does not appear to save it.  (Yes, I did select the "Save" button at the bottom of the "Local Datasources" pane.
> 
> So, my questions are:
> 
> 1. is the datasource list kept in a separate configuration by CM?
> 2. How do I manage the DataSource list so that the new datasource is saved?
> 3. How do I manage the project so I can control which datasource selection.
> 
> Thanks,
> Joe
>