Re: Commiting changes

2008-08-04 Thread Ian Jamieson
Thanks for that The the phrase "nested context" helped me find this page which explained it well. http://cayenne.apache.org/doc/nested-datacontexts.html That gives me more options to think about. On Tue, Aug 5, 2008 at 10:28 AM, Aristedes Maniatis <[EMAIL PROTECTED]> wrote: > > On 05/08/2008, a

Re: Commiting changes

2008-08-04 Thread Aristedes Maniatis
On 05/08/2008, at 11:58 AM, Ian Jamieson wrote: Is there a way to commit just a specific set of changes, without commiting all the changes in the context? Should I create separate DataContext instances if I want to do this? Yes, you should be creating separate contexts for this purpose. If

Commiting changes

2008-08-04 Thread Ian Jamieson
Is there a way to commit just a specific set of changes, without commiting all the changes in the context? Should I create separate DataContext instances if I want to do this?

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Matthias Moeser
Hi! Thank you Andrus and Andrey. I changed the mapping for the columns of datatype "text" from VARCHAR to CLOB (max length 32000) in Cayenne Modeler. Everything is working fine now for MS SQL server. But I also run the applicaion with embedded Derby, where I use VARCHAR (32000) in the sql

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Lachlan Deck
On 05/08/2008, at 6:49 AM, Andrus Adamchik wrote: Andrey, you are spot on with the UNSUPPORTED_DISTINCT_TYPES. Here is one caveat (and hopefully a workaround). "text" is a SQL Server native type; UNSUPPORTED_DISTINCT_TYPES stores abstract JDBC types. So I think Matthias can simply map his "

Re: Cayenne 3.0M4 ignoring extended data types

2008-08-04 Thread Chris Gamache
On Mon, Aug 4, 2008 at 5:52 PM, Chris Gamache <[EMAIL PROTECTED]> wrote: > > Test #1 and Test #2 fail with the same class cast exception until I > remove this pair of relations from the config file: > Correction: Test #2 and #3 fail, not #1 and #2. :) Details details!

Re: Cayenne 3.0M4 ignoring extended data types

2008-08-04 Thread Chris Gamache
On Mon, Aug 4, 2008 at 3:32 PM, Andrus Adamchik <[EMAIL PROTECTED]>wrote: > > Sure, but can you doublecheck that the types are loaded in the right > Configuration? I.e. after all libraries are loaded, can you grab the shared > configuration and print the contents of the ExtendedTypeMap? > > [BTW,

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Andrus Adamchik
Andrey, you are spot on with the UNSUPPORTED_DISTINCT_TYPES. Here is one caveat (and hopefully a workaround). "text" is a SQL Server native type; UNSUPPORTED_DISTINCT_TYPES stores abstract JDBC types. So I think Matthias can simply map his "text" column as a CLOB in Cayenne, and Cayenne wil

Re: Cayenne 3.0M4 ignoring extended data types

2008-08-04 Thread Andrus Adamchik
On Aug 4, 2008, at 3:14 PM, Chris Gamache wrote: That wipes my shared configuration each time a new library tries to instantiate Cayenne. I need to add to the already initialized Cayenne if Cayenne has been initialized, and the only way to determine if Cayenne has already been initialized (

Re: Cayenne 3.0M4 ignoring extended data types

2008-08-04 Thread Andrus Adamchik
On Aug 4, 2008, at 3:14 PM, Chris Gamache wrote: Also, this doesn't address the issue of ExtendedTypes being ignored for elements retrieved using a relational fetch in 3.0M4... It does if you install them in the COnfiguration instance that is not being used downstream. This is what I am

Re: Cayenne 3.0M4 ignoring extended data types

2008-08-04 Thread Chris Gamache
On Fri, Aug 1, 2008 at 5:23 PM, Andrus Adamchik <[EMAIL PROTECTED]>wrote: > This code looks suspect. I am not sure that after it is run, dc == > Configuration.getSharedConfiguration(). Can you do something like this > instead: > > DefaultConfiguration dc = new DefaultConfiguration(configuration);

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Andrey Razumovsky
I've looked at the code a bit. Turns out there're some UNSUPPORTED_DISTINCT_TYPES in SelectTranslator class. Probably if "text" type will be added there, this would let go the exceptions. I'll advice to open a JIRA issue about it. By now you could try use SQLTemplate. It will not generate any "dist

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Matthias Moeser
Hi, On 04/08/2008, at 5:49 PM, Lachlan Deck wrote: On 04/08/2008, at 5:39 PM, Andrey Razumovsky wrote: This is definitely MS SQL's issue, not Cayenne's. Only thing I can recommend, if you can allow that, select all rows and then seed out duplicate rows manually AFAIK we are not purposely tu

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Lachlan Deck
Hi there, On 04/08/2008, at 5:39 PM, Andrey Razumovsky wrote: This is definitely MS SQL's issue, not Cayenne's. Only thing I can recommend, if you can allow that, select all rows and then seed out duplicate rows manually AFAIK we are not purposely turning on the flag for obtaining distinct

Re: MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Andrey Razumovsky
This is definitely MS SQL's issue, not Cayenne's. Only thing I can recommend, if you can allow that, select all rows and then seed out duplicate rows manually 2008/8/4, Matthias Moeser <[EMAIL PROTECTED]>: > > Hi! > > We are using Cayenne with Microsoft SQL Server. We get a > com.microsoft.sqlserv

MS SQL Server: Select Distinct on text datatype

2008-08-04 Thread Matthias Moeser
Hi! We are using Cayenne with Microsoft SQL Server. We get a com.microsoft.sqlserver.jdbc.SQLServerException: "The text data type cannot be selected as DISTINCT because it is not comparable." The problem is that the following query is not allowed in MS SQL Server: SELECT DISTINCT column FR