cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Error generating pk
Date Mon, 03 Apr 2006 10:48:36 GMT
You didn't really find the reason :-) You downgraded the adapter to a  
generic one that doesn't use stored procedures for pk generation, but  
also doesn't know how to correctly handle SQLServer, hence the error  
below. The problem seems to be in the combination of C-JDBC driver  
and SQLServer database.

I suggest we do this:

1. You open the bug report, providing as much information about your  
environment as possible (at the very least the version of the driver  
and the version of the database), and we'll look at it at some point:

http://objectstyle.org/cayenne/bugs-features.html

2. You explicitly set the adapter to  
"org.objectstyle.cayenne.dba.sqlserver.SQLServerAdapter" in the  
Modeler, but then manually change PK generator in the code like this:

DataNode node = ...
JdbcAdapter adapter = (JdbcAdapter) node.getAdapter();
adapter.setPkGenerator(new JdbcPkGenerator());

Hope this'll straighten it for you.

Andrus


On Apr 3, 2006, at 2:32 PM, emre.yilmaz@htr.com.tr wrote:

> I find the reason of error. When I use the  
> org.objectstyle.cayenne.dba.JdbcAdapter generating the pk not throw  
> exception
> but in this case getting the blob datas in the database throws  
> exception like:
> java.io.InvalidClassException: java.util.ArrayList; local class  
> incompatible: stream classdesc serialVersionUID =  
> 8664875232659988799, local class serialVersionUID
> = 8683452581122892189
> 	at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
> 	at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
> 	at java.io.ObjectInputStream.readClassDesc(Unknown Source)
> 	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
> 	at java.io.ObjectInputStream.readObject0(Unknown Source)
> 	at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
> 	at java.io.ObjectInputStream.readSerialData(Unknown Source)
> 	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
> 	at java.io.ObjectInputStream.readObject0(Unknown Source)
> 	at java.io.ObjectInputStream.readObject(Unknown Source)
> 	at tr.com.htr.hgys.format.authority.BlobFormat.getObject 
> (BlobFormat.java:34)
> 	
> when I use the  
> org.objectstyle.cayenne.dba.sqlserver.SQLServerAdapter, blob fields  
> gets the data correctly but
> pk generation fails. How can I solve blob and pk generation  
> problems at the same time.
>
> ----- Orjinal Mesaj -----
> Kimden: Andrus Adamchik <andrus@objectstyle.org>
> Tarih: Monday, April 3, 2006 12:15
> Konu: Re: Error generating pk
> Kime: cayenne-user@incubator.apache.org
>
>> Sorry, you mentioned that in your other message. Unfortunately I
>> don't have test environment right now to try it with c-jdbc driver
>>
>> (maybe someone else does??) Still, can you provide more information.
>>
>> You've used Cayenne before and it worked in your environment,
>> right?
>> If so, when did it start to happen. Is this something that started
>> to
>> happen after switching to a specific version of Cayenne?
>>
>> Andrus
>>
>>
>> On Apr 3, 2006, at 1:04 PM, emre.yilmaz@htr.com.tr wrote:
>>
>>> Hi,
>>>
>>> I use MsSql server.
>>>
>>> ----- Orjinal Mesaj -----
>>> Kimden: Andrus Adamchik <andrus@objectstyle.org>
>>> Tarih: Monday, April 3, 2006 11:29
>>> Konu: Re: Error generating pk
>>> Kime: cayenne-user@incubator.apache.org
>>>
>>>> What database are you using? Is this Sybase? What version?
>>>>
>>>> Andrus
>>>>
>>>>
>>>> On Apr 3, 2006, at 11:11 AM, emre.yilmaz@htr.com.tr wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I get the below exeption for rich client database table row
>>>>> generating.
>>>>> How can I store result set from stored procedure.
>>>>>
>>>>> org.objectstyle.cayenne.CayenneRuntimeException: [v.1.2-
>>>>> dev-2006-2-23 February 23 2006] Error generating pk for DbEntity
>>>>
>>>>> Title, no result set from stored
>>>>> procedure.
>>>>> 	at
>>>>>
>>>> org.objectstyle.cayenne.dba.sybase.SybasePkGenerator.pkFromDatabase
>>>>> (SybasePkGenerator.java:197)
>>>>> 	at
>>>>>
>>>> org.objectstyle.cayenne.dba.JdbcPkGenerator.generatePkForDbEntity
>>>>> (JdbcPkGenerator.java:326)
>>>>> 	at
>>>>>
>>>>
>> org.objectstyle.cayenne.access.PrimaryKeyHelper.createPermIdsForObjEn
>>>> t
>>>>> ity(PrimaryKeyHelper.java:188)
>>>>> 	at
>>>>>
>>>>
>> org.objectstyle.cayenne.access.DataDomainPrecommitAction.createPrimar
>>>> y
>>>>> Key(DataDomainPrecommitAction.java:132)
>>>>> 	at
>>>>>
>>>> org.objectstyle.cayenne.access.DataDomainPrecommitAction.precommit
>>>>> (DataDomainPrecommitAction.java:108)
>>>>> 	at
>>>> org.objectstyle.cayenne.access.DataDomain.onSyncFlushInternal
>>>>> (DataDomain.java:799)
>>>>> 	at org.objectstyle.cayenne.access.DataDomain$2.transform
>>>>> (DataDomain.java:767)
>>>>> 	at org.objectstyle.cayenne.access.DataDomain.runInTransaction
>>>>> (DataDomain.java:827)
>>>>> 	at org.objectstyle.cayenne.access.DataDomain.onSync
>>>>> (DataDomain.java:764)
>>>>> 	at org.objectstyle.cayenne.access.DataContext.flushToParent
>>>>> (DataContext.java:1227)
>>>>> 	at org.objectstyle.cayenne.access.DataContext.commitChanges
>>>>> (DataContext.java:1085)
>>>>> 	at tr.com.htr.hgys.db.Title.setTitle(Title.java:101)
>>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>


Mime
View raw message