RE: Temporary ID hasn't been replaced on commit

2012-03-16 Thread cghersi
: lunedì 12 marzo 2012 12:18 To: cghersi Subject: Re: Temporary ID hasn't been replaced on commit Are you using one datacontext for the entire application? Generally, you want one datacontext per user, or even one datacontext per request, depending on your use-case. The exception is a "

Re: Temporary ID hasn't been replaced on commit

2012-03-12 Thread Robert Zeigler
e.cayenne.access.DataContext.flushToParent(DataContext.java:1106) > > at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045) > > > > > > This issue is really driving me crazy!! > > Please, let me know what I’m doing wrong… > > > &

RE: Temporary ID hasn't been replaced on commit

2012-03-12 Thread cghersi
!! Please, let me know what I’m doing wrong… Thank you very much Best cghersi From: Cristiano Ghersi [mailto:cristiano.ghe...@abodata.com] Sent: lunedì 12 marzo 2012 10:01 To: 'Andrus Adamchik [via Cayenne]' Subject: RE: Temporary ID hasn't been replaced on commit

RE: Temporary ID hasn't been replaced on commit

2012-03-12 Thread cghersi
only to a single table? Thank you very much. Best cghersi From: Andrus Adamchik [via Cayenne] [mailto:ml-node+s195n3813176...@n3.nabble.com] Sent: venerdì 9 marzo 2012 17:41 To: cghersi Subject: Re: Temporary ID hasn't been replaced on commit Sorry this is Cayenne 3.1 API, and

Re: Temporary ID hasn't been replaced on commit

2012-03-09 Thread Andrus Adamchik
ample of use? > > > > Thank you very much. > > Best > > cghersi > > > > From: Andrus Adamchik [via Cayenne] > [mailto:ml-node+s195n3812833...@n3.nabble.com] > Sent: venerdì 9 marzo 2012 15:40 > To: cghersi > Subject: Re: Temporary ID hasn't

Re: Temporary ID hasn't been replaced on commit

2012-03-09 Thread Michael Gentry
Hi Cristiano, For Cayenne 3.0, it is in DataObjectUtils.intPKForObject(). mrg On Fri, Mar 9, 2012 at 11:33 AM, cghersi wrote: > I cannot find documentation for your proposal (Cayenne.inPkForObject): may > you give me an example of use?

RE: Temporary ID hasn't been replaced on commit

2012-03-09 Thread cghersi
Subject: Re: Temporary ID hasn't been replaced on commit > Is there any effective way to directly retrieve the ID of the just added > object after the context.commitChanges() invocation? After commit the ID should be available via normal Cayenne APIs (e.g. Cayenne.inPkForObject).

Re: Temporary ID hasn't been replaced on commit

2012-03-09 Thread Andrus Adamchik
> > > > Best > > cghersi > > > > From: cghersi [via Cayenne] [mailto:ml-node+s195n3806195...@n3.nabble.com] > Sent: mercoledì 7 marzo 2012 09:43 > To: cghersi > Subject: Re: Temporary ID hasn't been replaced on commit > > > > Hi A

RE: Temporary ID hasn't been replaced on commit

2012-03-09 Thread cghersi
: mercoledì 7 marzo 2012 09:43 To: cghersi Subject: Re: Temporary ID hasn't been replaced on commit Hi Andrus, here there's the code that I use to save my object: private AtomicReference context = new AtomicReference(config.getDomain("PacketDomain"

Re: Temporary ID hasn't been replaced on commit

2012-03-07 Thread cghersi
Hi Andrus, here there's the code that I use to save my object: private AtomicReference context = new AtomicReference(config.getDomain("PacketDomain").createDataContext()); public Network GetNetworkByPK(Integer pkID) { ObjectId id = new ObjectId(Network.c

Re: Temporary ID hasn't been replaced on commit

2012-03-06 Thread Andrus Adamchik
I feel like at this point I can't help much without access to the code in debugger :-/ On Mar 6, 2012, at 4:48 AM, cghersi wrote: > Hi Michael, > thank you for the hint. > I double checked the To Dep PK option and in fact some of the relationships > were wrong, but nevertheless the problem persi

Re: Temporary ID hasn't been replaced on commit

2012-03-06 Thread cghersi
Hi Michael, thank you for the hint. I double checked the To Dep PK option and in fact some of the relationships were wrong, but nevertheless the problem persists. The problem is now a NullPointerException on DataObjectUtils, line 114: ObjectId id = dataObject.getObjectId(); if (!id

Re: Temporary ID hasn't been replaced on commit

2012-03-05 Thread Michael Gentry
That would be my guess ... Can you double check that you do not have a cyclic graph? The AshwoodEntitySorter sometimes gets wrapped around the axle and doesn't throw an exception when it should. When you have to-many (or to-dependent PK) relationships, the owning object must be inserted first.

RE: Temporary ID hasn't been replaced on commit

2012-03-05 Thread cghersi
] Sent: lunedì 5 marzo 2012 17:49 To: cghersi Subject: Re: Temporary ID hasn't been replaced on commit On Mar 5, 2012, at 11:41 AM, cghersi wrote: > This table is involved in a lot of relationships: is this a possible cause > of failures? Possibly. Can you check if there is a r

Re: Temporary ID hasn't been replaced on commit

2012-03-05 Thread cghersi
Here there is the snippet of code that I use to save my object: ... private AtomicReference context = new AtomicReference(config.getDomain("PacketDomain").createDataContext()); private void CommitObjects(Class objClass){ synchronized(context){

Re: Temporary ID hasn't been replaced on commit

2012-03-05 Thread Andrus Adamchik
On Mar 5, 2012, at 11:41 AM, cghersi wrote: > This table is involved in a lot of relationships: is this a possible cause > of failures? Possibly. Can you check if there is a relationship pointing to this table with "To Dep PK" checked. Andrus

Re: Temporary ID hasn't been replaced on commit

2012-03-05 Thread cghersi
here there is the part of xml config file:

Re: Temporary ID hasn't been replaced on commit

2012-03-05 Thread Andrus Adamchik
Looks good. If it is also "Database-generated" in Cayenne model, then everything I can think of is correct. Based on the information that you've provided, I can't think of anything else Cayenne-related that might cause it :-/ Andrus On Mar 5, 2012, at 11:10 AM, cghersi wrote: > Hi Andrus, than

RE: Temporary ID hasn't been replaced on commit

2012-03-05 Thread cghersi
Hi Joachim, I’m sorry, An error occurred while posting my message, this is the cause of the duplicates! From: Durchholz, Joachim [via Cayenne] [mailto:ml-node+s195n3801091...@n3.nabble.com] Sent: lunedì 5 marzo 2012 17:11 To: cghersi Subject: RE: Temporary ID hasn't been replac

RE: Temporary ID hasn't been replaced on commit

2012-03-05 Thread Durchholz, Joachim
Oops, sorry, I meant to reply in private. (For some reason, Outlook replies to the list regardless of whether I click "reply to all" or "reply to sender". And I keep forgetting to insert the proper recipient manually because it works with Firefox, on other lists - dunno whether it's the program

Re: Temporary ID hasn't been replaced on commit

2012-03-05 Thread cghersi
Hi Andrus, thank you for the fast reply! The DB is MySQL. The table is created with a code like this: CREATE TABLE PhysicalNode (AdditionalArgs VARCHAR(4000) NULL, BatteryLevel SMALLINT NULL, CoordX DOUBLE NOT NULL, CoordY DOUBLE NOT NULL, CoordZ DOUBLE NOT NULL, Creation BIGINT NOT NULL, CurrentP

RE: Temporary ID hasn't been replaced on commit

2012-03-05 Thread Durchholz, Joachim
Cristiano, can you please stop spamming the Cayenne mailing list with repetitions of the always same message? (This may be a misconfiguration of the mail server through which you're sending the message.) Thanks. Jo -Original Message- From: cghersi [mailto:cristiano.ghe...@abodata.com]

Re: Temporary ID hasn't been replaced on commit

2012-03-05 Thread Andrus Adamchik
Hi cghersi, can you check the table in question on the DB side to see that it is configured to autoincrement an ID column. You haven't mentioned what DB you are using, so here is an example for MySQL (see 'auto_increment' in the 'Extra' column) : > desc mytable; +---

Re: Temporary ID hasn't been replaced on commit

2009-12-10 Thread Juergen Saar
Sorry, my fault ... it seems, I hat the wrong API-Docs selected 2009/12/10 Andrus Adamchik : > Hmm.. Where did you see it? It can't be in the Javadocs (as it's not in the > interface). I found one piece of old docs though:

Re: Temporary ID hasn't been replaced on commit

2009-12-10 Thread Andrus Adamchik
On Dec 10, 2009, at 10:03 AM, Juergen Saar wrote: I've seen it too, but it's not really what I'm looking for ... it should be good for a workaround, so that I can find my PrimaryKey There's no ResultIterator API anymore to read ID's from a wider row. But yes, you can create the ID yourself

Re: Temporary ID hasn't been replaced on commit

2009-12-10 Thread Juergen Saar
I've seen it too, but it's not really what I'm looking for ... it should be good for a workaround, so that I can find my PrimaryKey What I'm not really sure with Cayenne-3: What is the Best Practise for Batchprocessing really big Resultsets. I used the ResultIterator because of it's small footprin

Re: Temporary ID hasn't been replaced on commit

2009-12-10 Thread Michael Gentry
I haven't used it before, but I see a nextRow() method in ResultIterator that may be what you are looking for. mrg On Thu, Dec 10, 2009 at 4:21 AM, Juergen Saar wrote: > Hi, > > there seems to be a change in org.apache.cayenne.access.ResultIterator > with version 3 ... I'm missing the method  n

Re: Temporary ID hasn't been replaced on commit

2009-12-10 Thread Juergen Saar
Hi, there seems to be a change in org.apache.cayenne.access.ResultIterator with version 3 ... I'm missing the method  nextObjectId(DbEntity entity) ... in the API-Docs it is still documented. I used this method to reduce assignment of memory space while working with big results. Any advice for m

Re: Temporary ID hasn't been replaced on commit

2009-11-25 Thread Michael Gentry
On Wed, Nov 25, 2009 at 8:47 AM, Juergen Saar wrote: > For using 3.0 in productive environment ... Is there a time-scale for the > final 3.0? There isn't a final date, but hope to have it out soon. However, I don't think you should let the beta label stop you. I'm using 3.0B1 in something I pla

Re: Temporary ID hasn't been replaced on commit

2009-11-25 Thread Andrus Adamchik
As you probably know, we are already in Beta and Cayenne runtime framework code is frozen. So it is 100% stable from the API perspective. And after 1 or 2 intermediate releases it becomes final. Timewise, I don't know, maybe a couple of months? Andrus On Nov 25, 2009, at 3:47 PM, Juergen S

Re: Temporary ID hasn't been replaced on commit

2009-11-25 Thread Juergen Saar
I'm in preparations for 3.0 ... but there was a lot of trouble this year, so I didn't get as far as I planned ... For using 3.0 in productive environment ... Is there a time-scale for the final 3.0? 2009/11/25 Andrus Adamchik > Do you have an option of trying this with 3.0? There were a few bu

Re: Temporary ID hasn't been replaced on commit

2009-11-25 Thread Andrus Adamchik
Do you have an option of trying this with 3.0? There were a few bug fixes related to unstable data types in ObjectIds (e.g. the same ID can have a PK mapping as a BigDecimal or Integer depending on how object was obtained). Could be something related. Andrus On Nov 25, 2009, at 10:32 AM,

Re: Temporary ID hasn't been replaced on commit

2009-11-25 Thread Juergen Saar
I'm using Version 2.0.4 ... 2009/11/25 Andrus Adamchik > Don't yet know what might be causing it, but what version of Cayenne are > you using? > > Andrus > > > On Nov 25, 2009, at 9:49 AM, Juergen Saar wrote: > > Hi, >> >> we're using cayenne for the web-interface of a 20 year old project with

Re: Temporary ID hasn't been replaced on commit

2009-11-24 Thread Andrus Adamchik
Don't yet know what might be causing it, but what version of Cayenne are you using? Andrus On Nov 25, 2009, at 9:49 AM, Juergen Saar wrote: Hi, we're using cayenne for the web-interface of a 20 year old project with meaningful keys. We don't use tapestry. The keys are handled in the vali