You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Gary Jarrel <ga...@gmail.com> on 2007/09/19 12:12:36 UTC

Temp ID issue - Exception

Hi Guys!

Any thoughts on what could be causing this during commit?

org.apache.cayenne.CayenneRuntimeException: [v.3.0M1 Jul 27 2007
23:05:47] Can't build a query for temporary id:
<ObjectId:CorrespondenceRecepientNotification, TEMP:0000032DC4F40101>
        at org.apache.cayenne.query.ObjectIdQuery.createReplacementQuery(ObjectIdQuery.java:120)
        at org.apache.cayenne.query.IndirectQuery.getReplacementQuery(IndirectQuery.java:75)
        at org.apache.cayenne.query.IndirectQuery.route(IndirectQuery.java:58)
        at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:
<snip>

I've did some googling and came across similar errors, all which
related to version 1.2 of Cayenne and all appear to have been resolved
based on the Jira issues which I read?

Thank you!

Gary

RE: Deletion of obejcts

Posted by Jan Lendholt <jl...@hotmail.com>.
Well, I just saw, that these deleted objects have the PersistenceState TRANSIENT.
Why are they then still listed in the array? Do I really manually have to check the PS on each request on an array list? That really sounds strange to me...



> Date: Mon, 19 Nov 2007 15:08:38 -0500
> Subject: Re: Deletion of obejcts
> From: kmenard@servprise.com
> To: user@cayenne.apache.org
> 
> Hi Jan,
> 
> On 11/19/07 1:48 PM, "Jan Lendholt" <jl...@hotmail.com> wrote:
> 
> > The relationship is from booking to Extras one to many (1-n entries in Extra
> > for one booking entry).
> > I've set both relationships with delete rule to nullify.
> 
> Are you sure that's correct?  It would seem to me that you would want to
> cascade in one direction and do nothing in the other.  I.e., you would
> probably want to delete all extras (cascade) if the Booking is deleted, but
> do nothing if an Extra is deleted.
> 
> -- 
> Kevin Menard
> Servprise International, Inc.
> Remote reboot & power control for network equipment
> www.servprise.com              +1 508.892.3823 x308
> 

_________________________________________________________________
Neu: Internet Explorer 7 optimiert für MSN!
http://optimize.de.msn.com/default.aspx?mkt=de-de

RE: Deletion of obejcts

Posted by Kevin Menard <km...@servprise.com>.
The rules I suggested are what you want.  They are also consistent with
foreign key deletion rules used by many RDBMSs.

Please note that with nullify, only the object that was deleted should
be yanked out of the context.  Otherwise, the only thing that is
happening is that the other end of the relationship is being set to
NULL.  Moreover, this is only happening inside of Cayenne, so even if
your DB ultimately disallows NULL values in those columns, you won't
trip over validation until you try to commit all of those objects.  This
is because it is perfectly legal to have an "inconsistent" object sit
around in memory as you set values on it.

-- 
Kevin

-----Original Message-----
From: Jan Lendholt [mailto:jlendholt@hotmail.com] 
Sent: Monday, November 19, 2007 3:12 PM
To: user@cayenne.apache.org
Subject: RE: Deletion of obejcts

Well, what would be the right rule for me?

I want - if booking recordset is deleted - to delete everything in
extras.
If a recordset in extras is deleted, I simply want the row to be
deleted. That works perfectly - but the object graph seems not get
updated :/

RE: Deletion of obejcts

Posted by Jan Lendholt <jl...@hotmail.com>.
Well, what would be the right rule for me?

I want - if booking recordset is deleted - to delete everything in extras.
If a recordset in extras is deleted, I simply want the row to be deleted. That works perfectly - but the object graph seems not get updated :/



> Date: Mon, 19 Nov 2007 15:08:38 -0500
> Subject: Re: Deletion of obejcts
> From: kmenard@servprise.com
> To: user@cayenne.apache.org
> 
> Hi Jan,
> 
> On 11/19/07 1:48 PM, "Jan Lendholt" <jl...@hotmail.com> wrote:
> 
> > The relationship is from booking to Extras one to many (1-n entries in Extra
> > for one booking entry).
> > I've set both relationships with delete rule to nullify.
> 
> Are you sure that's correct?  It would seem to me that you would want to
> cascade in one direction and do nothing in the other.  I.e., you would
> probably want to delete all extras (cascade) if the Booking is deleted, but
> do nothing if an Extra is deleted.
> 
> -- 
> Kevin Menard
> Servprise International, Inc.
> Remote reboot & power control for network equipment
> www.servprise.com              +1 508.892.3823 x308
> 

_________________________________________________________________
Die neue Version vom Windows Live Messenger ist da!
http://get.live.com/messenger/overview

Re: Deletion of objects

Posted by Andrus Adamchik <an...@objectstyle.org>.
Would be nice to open a Jira with details. We should be able to do  
something about it.

Andrus


On Nov 22, 2007, at 12:43 AM, Jan Lendholt wrote:

> Okay, I found the error - I used a wrong datatype for the  
> matchExpression.
> Well, in fact this is a stupid mistake by me; but in my opinion the  
> framework could handle this more smoothly.
>
> Just told you this nice exception as a illustration on how difficult  
> it could become working with cayenne if one is just a bit hasty on  
> cayennes use.
> I think that hibernate in this context is more reliable; but  
> therefore requires more work to be running at first.
> But dont want to talk about that now.
>
> Greets Jan
>
>
>
>> From: jlendholt@hotmail.com
>> To: user@cayenne.apache.org
>> Subject: RE: Deletion of obejcts
>> Date: Wed, 21 Nov 2007 22:38:34 +0000
>>
>> Hey Kevin,
>>
>> here is one of those exceptions I cannot get used to:
>>
>> java.lang.NullPointerException
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .access 
>> .trans 
>> .QualifierTranslator.appendObjectMatch(QualifierTranslator.java:153)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .access.trans.QualifierTranslator.endNode(QualifierTranslator.java: 
>> 321)
>>    at org.apache.cayenne.exp.Expression.traverse(Expression.java:520)
>>    at org.apache.cayenne.exp.Expression.traverse(Expression.java:511)
>>    at org.apache.cayenne.exp.Expression.traverse(Expression.java:491)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .access 
>> .trans.QualifierTranslator.doTranslation(QualifierTranslator.java:74)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .access 
>> .trans.SelectTranslator.createSqlString(SelectTranslator.java:129)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .access.trans.QueryAssembler.createStatement(QueryAssembler.java:95)
>>    at  
>> org 
>> .apache 
>> .cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:71)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:59)
>>    at  
>> org.apache.cayenne.access.DataNode.performQueries(DataNode.java:273)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java: 
>> 301)
>>    at org.apache.cayenne.access.DataDomainQueryAction.access 
>> $000(DataDomainQueryAction.java:60)
>>    at org.apache.cayenne.access.DataDomainQueryAction 
>> $1.transform(DataDomainQueryAction.java:273)
>>    at  
>> org 
>> .apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java: 
>> 836)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .access 
>> .DataDomainQueryAction 
>> .runQueryInTransaction(DataDomainQueryAction.java:270)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .access.DataDomainQueryAction.execute(DataDomainQueryAction.java:110)
>>    at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java: 
>> 746)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .util 
>> .ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:217)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .access.DataContextQueryAction.execute(DataContextQueryAction.java: 
>> 54)
>>    at  
>> org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1387)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .util 
>> .ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:217)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .access.DataContextQueryAction.execute(DataContextQueryAction.java: 
>> 54)
>>    at  
>> org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1387)
>>    at  
>> org.apache.cayenne.access.DataContext.performQuery(DataContext.java: 
>> 1376)
>>    at  
>> ams 
>> .maintabpanes 
>> .buchungdetail 
>> .SingleBuchungContentPaneCatering 
>> .<init>(SingleBuchungContentPaneCatering.java:195)
>>    at  
>> ams 
>> .maintabpanes 
>> .buchungdetail 
>> .BuchungDetailWindowPane.<init>(BuchungDetailWindowPane.java:103)
>>    at ams.maintabpanes.event.EventTabPane 
>> $4.actionPerformed(EventTabPane.java:522)
>>    at  
>> nextapp 
>> .echo2 
>> .app.button.AbstractButton.fireActionPerformed(AbstractButton.java: 
>> 135)
>>    at nextapp.echo2.app.button.AbstractButton 
>> $1.actionPerformed(AbstractButton.java:100)
>>    at  
>> nextapp 
>> .echo2 
>> .app 
>> .button 
>> .DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:70)
>>    at  
>> nextapp 
>> .echo2 
>> .app.button.DefaultButtonModel.doAction(DefaultButtonModel.java:58)
>>    at  
>> nextapp 
>> .echo2.app.button.AbstractButton.doAction(AbstractButton.java:121)
>>    at  
>> nextapp 
>> .echo2.app.button.AbstractButton.processInput(AbstractButton.java: 
>> 506)
>>    at  
>> nextapp 
>> .echo2 
>> .app.update.ClientUpdateManager.process(ClientUpdateManager.java:116)
>>    at  
>> nextapp 
>> .echo2 
>> .app.update.UpdateManager.processClientUpdates(UpdateManager.java:89)
>>    at  
>> nextapp 
>> .echo2 
>> .webcontainer 
>> .ContainerSynchronizeService 
>> .renderUpdate(ContainerSynchronizeService.java:472)
>>    at  
>> nextapp 
>> .echo2 
>> .webrender 
>> .service.SynchronizeService.service(SynchronizeService.java:279)
>>    at  
>> nextapp 
>> .echo2.webrender.WebRenderServlet.process(WebRenderServlet.java:276)
>>    at  
>> nextapp 
>> .echo2.webrender.WebRenderServlet.doPost(WebRenderServlet.java:192)
>>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>>    at ams.AMSServlet.service(AMSServlet.java:36)
>>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>    at  
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: 
>> 356)
>>    at org.mortbay.jetty.servlet.WebApplicationHandler 
>> $Chain.doFilter(WebApplicationHandler.java:342)
>>    at  
>> org 
>> .apache 
>> .cayenne 
>> .conf 
>> .WebApplicationContextFilter 
>> .doFilter(WebApplicationContextFilter.java:91)
>>    at org.mortbay.jetty.servlet.WebApplicationHandler 
>> $Chain.doFilter(WebApplicationHandler.java:334)
>>    at  
>> org 
>> .mortbay 
>> .jetty 
>> .servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java: 
>> 286)
>>    at  
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 
>> 567)
>>    at org.mortbay.http.HttpContext.handle(HttpContext.java:1776)
>>    at  
>> org 
>> .mortbay 
>> .jetty 
>> .servlet.WebApplicationContext.handle(WebApplicationContext.java:514)
>>    at org.mortbay.http.HttpContext.handle(HttpContext.java:1726)
>>    at org.mortbay.http.HttpServer.service(HttpServer.java:879)
>>    at org.mortbay.http.HttpConnection.service(HttpConnection.java: 
>> 790)
>>    at  
>> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:952)
>>    at org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)
>>    at  
>> org 
>> .mortbay.http.SocketListener.handleConnection(SocketListener.java: 
>> 196)
>>    at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
>>    at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:487)
>>
>>
>> Well, the only thing I was doing was setting up a select query end  
>> performing the query. I received this.
>>
>> How shall someone solve this issue without having a look into  
>> cayenne's sources?
>> I developed quite a few frameworks for company-internal uses and I  
>> am ALWAYS checking, if all possible exceptions are correctly caught  
>> and at least giving a possible reasong for an exception. For now, I  
>> did not solve the problem but guess, there something wrong in my  
>> statement; but even if: The framework should handle this more  
>> gently telling me where the problem exactly lies.
>>
>> Thanks a lot.
>>
>> Jan
>>
>>
>>> Date: Mon, 19 Nov 2007 20:16:04 -0500
>>> Subject: Re: Deletion of obejcts
>>> From: kmenard@servprise.com
>>> To: user@cayenne.apache.org
>>>
>>> If you're having another issue, please start a new thread and post  
>>> the
>>> relevant code snippets and exception message.  I'll be the first  
>>> to beat up
>>> on Cayenne's error messages, so if you can give concrete examples  
>>> of where
>>> they fail, I'll try to get them fixed for you.
>>>
>>>
>>> On 11/19/07 7:10 PM, "Jan Lendholt" <jl...@hotmail.com> wrote:
>>>
>>>> Thanks all for your replies. I will try that one out (deleting an  
>>>> iterator).
>>>>
>>>> but, yet another problem: Ich use an object and say:
>>>> object.removeFromTestArray(Test);
>>>> Afterwards I call Test.getDataContext().commitChanges() to make  
>>>> these changes
>>>> persistent; but all I get is a "Null Objectid" exception which is  
>>>> yet again an
>>>> exception which requires a good overview over cayenne's  
>>>> internals; to me and
>>>> all my people around these error messages cayenne throws are not  
>>>> just a bit
>>>> intuitive :(
>>>>
>>>> _________________________________________________________________
>>>> Neu: Internet Explorer 7 optimiert für MSN!
>>>> http://optimize.de.msn.com/default.aspx?mkt=de-de
>>>
>>> -- 
>>> Kevin Menard
>>> Servprise International, Inc.
>>> Remote reboot & power control for network equipment
>>> www.servprise.com              +1 508.892.3823 x308
>>>
>>
>> _________________________________________________________________
>> Windows Live Fotogalerie: So einfach organisieren Sie Ihre Fotos!
>> http://get.live.com/photogallery/overview
>
> _________________________________________________________________
> Jetzt kostenlos downloaden: 30 Messenger Emoticons!
> http://www.messenger-emoticons.de/


RE: Deletion of obejcts

Posted by Jan Lendholt <jl...@hotmail.com>.
Okay, I found the error - I used a wrong datatype for the matchExpression.
Well, in fact this is a stupid mistake by me; but in my opinion the framework could handle this more smoothly.

Just told you this nice exception as a illustration on how difficult it could become working with cayenne if one is just a bit hasty on cayennes use.
I think that hibernate in this context is more reliable; but therefore requires more work to be running at first.
But dont want to talk about that now.

Greets Jan



> From: jlendholt@hotmail.com
> To: user@cayenne.apache.org
> Subject: RE: Deletion of obejcts
> Date: Wed, 21 Nov 2007 22:38:34 +0000
> 
> Hey Kevin,
> 
> here is one of those exceptions I cannot get used to:
> 
> java.lang.NullPointerException
>     at org.apache.cayenne.access.trans.QualifierTranslator.appendObjectMatch(QualifierTranslator.java:153)
>     at org.apache.cayenne.access.trans.QualifierTranslator.endNode(QualifierTranslator.java:321)
>     at org.apache.cayenne.exp.Expression.traverse(Expression.java:520)
>     at org.apache.cayenne.exp.Expression.traverse(Expression.java:511)
>     at org.apache.cayenne.exp.Expression.traverse(Expression.java:491)
>     at org.apache.cayenne.access.trans.QualifierTranslator.doTranslation(QualifierTranslator.java:74)
>     at org.apache.cayenne.access.trans.SelectTranslator.createSqlString(SelectTranslator.java:129)
>     at org.apache.cayenne.access.trans.QueryAssembler.createStatement(QueryAssembler.java:95)
>     at org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:71)
>     at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:59)
>     at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:273)
>     at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:301)
>     at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:60)
>     at org.apache.cayenne.access.DataDomainQueryAction$1.transform(DataDomainQueryAction.java:273)
>     at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:836)
>     at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:270)
>     at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:110)
>     at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:746)
>     at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:217)
>     at org.apache.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:54)
>     at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1387)
>     at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:217)
>     at org.apache.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:54)
>     at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1387)
>     at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1376)
>     at ams.maintabpanes.buchungdetail.SingleBuchungContentPaneCatering.<init>(SingleBuchungContentPaneCatering.java:195)
>     at ams.maintabpanes.buchungdetail.BuchungDetailWindowPane.<init>(BuchungDetailWindowPane.java:103)
>     at ams.maintabpanes.event.EventTabPane$4.actionPerformed(EventTabPane.java:522)
>     at nextapp.echo2.app.button.AbstractButton.fireActionPerformed(AbstractButton.java:135)
>     at nextapp.echo2.app.button.AbstractButton$1.actionPerformed(AbstractButton.java:100)
>     at nextapp.echo2.app.button.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:70)
>     at nextapp.echo2.app.button.DefaultButtonModel.doAction(DefaultButtonModel.java:58)
>     at nextapp.echo2.app.button.AbstractButton.doAction(AbstractButton.java:121)
>     at nextapp.echo2.app.button.AbstractButton.processInput(AbstractButton.java:506)
>     at nextapp.echo2.app.update.ClientUpdateManager.process(ClientUpdateManager.java:116)
>     at nextapp.echo2.app.update.UpdateManager.processClientUpdates(UpdateManager.java:89)
>     at nextapp.echo2.webcontainer.ContainerSynchronizeService.renderUpdate(ContainerSynchronizeService.java:472)
>     at nextapp.echo2.webrender.service.SynchronizeService.service(SynchronizeService.java:279)
>     at nextapp.echo2.webrender.WebRenderServlet.process(WebRenderServlet.java:276)
>     at nextapp.echo2.webrender.WebRenderServlet.doPost(WebRenderServlet.java:192)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>     at ams.AMSServlet.service(AMSServlet.java:36)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>     at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:356)
>     at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342)
>     at org.apache.cayenne.conf.WebApplicationContextFilter.doFilter(WebApplicationContextFilter.java:91)
>     at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334)
>     at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286)
>     at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>     at org.mortbay.http.HttpContext.handle(HttpContext.java:1776)
>     at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:514)
>     at org.mortbay.http.HttpContext.handle(HttpContext.java:1726)
>     at org.mortbay.http.HttpServer.service(HttpServer.java:879)
>     at org.mortbay.http.HttpConnection.service(HttpConnection.java:790)
>     at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:952)
>     at org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)
>     at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:196)
>     at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
>     at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:487)
> 
> 
> Well, the only thing I was doing was setting up a select query end performing the query. I received this.
> 
> How shall someone solve this issue without having a look into cayenne's sources?
> I developed quite a few frameworks for company-internal uses and I am ALWAYS checking, if all possible exceptions are correctly caught and at least giving a possible reasong for an exception. For now, I did not solve the problem but guess, there something wrong in my statement; but even if: The framework should handle this more gently telling me where the problem exactly lies.
> 
> Thanks a lot.
> 
> Jan
> 
> 
> > Date: Mon, 19 Nov 2007 20:16:04 -0500
> > Subject: Re: Deletion of obejcts
> > From: kmenard@servprise.com
> > To: user@cayenne.apache.org
> > 
> > If you're having another issue, please start a new thread and post the
> > relevant code snippets and exception message.  I'll be the first to beat up
> > on Cayenne's error messages, so if you can give concrete examples of where
> > they fail, I'll try to get them fixed for you.
> > 
> > 
> > On 11/19/07 7:10 PM, "Jan Lendholt" <jl...@hotmail.com> wrote:
> > 
> > > Thanks all for your replies. I will try that one out (deleting an iterator).
> > > 
> > > but, yet another problem: Ich use an object and say:
> > > object.removeFromTestArray(Test);
> > > Afterwards I call Test.getDataContext().commitChanges() to make these changes
> > > persistent; but all I get is a "Null Objectid" exception which is yet again an
> > > exception which requires a good overview over cayenne's internals; to me and
> > > all my people around these error messages cayenne throws are not just a bit
> > > intuitive :( 
> > > 
> > > _________________________________________________________________
> > > Neu: Internet Explorer 7 optimiert für MSN!
> > > http://optimize.de.msn.com/default.aspx?mkt=de-de
> > 
> > -- 
> > Kevin Menard
> > Servprise International, Inc.
> > Remote reboot & power control for network equipment
> > www.servprise.com              +1 508.892.3823 x308
> > 
> 
> _________________________________________________________________
> Windows Live Fotogalerie: So einfach organisieren Sie Ihre Fotos!
> http://get.live.com/photogallery/overview 

_________________________________________________________________
Jetzt kostenlos downloaden: 30 Messenger Emoticons!
http://www.messenger-emoticons.de/

RE: Deletion of obejcts

Posted by Jan Lendholt <jl...@hotmail.com>.
Hey Kevin,

here is one of those exceptions I cannot get used to:

java.lang.NullPointerException
    at org.apache.cayenne.access.trans.QualifierTranslator.appendObjectMatch(QualifierTranslator.java:153)
    at org.apache.cayenne.access.trans.QualifierTranslator.endNode(QualifierTranslator.java:321)
    at org.apache.cayenne.exp.Expression.traverse(Expression.java:520)
    at org.apache.cayenne.exp.Expression.traverse(Expression.java:511)
    at org.apache.cayenne.exp.Expression.traverse(Expression.java:491)
    at org.apache.cayenne.access.trans.QualifierTranslator.doTranslation(QualifierTranslator.java:74)
    at org.apache.cayenne.access.trans.SelectTranslator.createSqlString(SelectTranslator.java:129)
    at org.apache.cayenne.access.trans.QueryAssembler.createStatement(QueryAssembler.java:95)
    at org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:71)
    at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:59)
    at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:273)
    at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:301)
    at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:60)
    at org.apache.cayenne.access.DataDomainQueryAction$1.transform(DataDomainQueryAction.java:273)
    at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:836)
    at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:270)
    at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:110)
    at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:746)
    at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:217)
    at org.apache.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:54)
    at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1387)
    at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:217)
    at org.apache.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:54)
    at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1387)
    at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1376)
    at ams.maintabpanes.buchungdetail.SingleBuchungContentPaneCatering.<init>(SingleBuchungContentPaneCatering.java:195)
    at ams.maintabpanes.buchungdetail.BuchungDetailWindowPane.<init>(BuchungDetailWindowPane.java:103)
    at ams.maintabpanes.event.EventTabPane$4.actionPerformed(EventTabPane.java:522)
    at nextapp.echo2.app.button.AbstractButton.fireActionPerformed(AbstractButton.java:135)
    at nextapp.echo2.app.button.AbstractButton$1.actionPerformed(AbstractButton.java:100)
    at nextapp.echo2.app.button.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:70)
    at nextapp.echo2.app.button.DefaultButtonModel.doAction(DefaultButtonModel.java:58)
    at nextapp.echo2.app.button.AbstractButton.doAction(AbstractButton.java:121)
    at nextapp.echo2.app.button.AbstractButton.processInput(AbstractButton.java:506)
    at nextapp.echo2.app.update.ClientUpdateManager.process(ClientUpdateManager.java:116)
    at nextapp.echo2.app.update.UpdateManager.processClientUpdates(UpdateManager.java:89)
    at nextapp.echo2.webcontainer.ContainerSynchronizeService.renderUpdate(ContainerSynchronizeService.java:472)
    at nextapp.echo2.webrender.service.SynchronizeService.service(SynchronizeService.java:279)
    at nextapp.echo2.webrender.WebRenderServlet.process(WebRenderServlet.java:276)
    at nextapp.echo2.webrender.WebRenderServlet.doPost(WebRenderServlet.java:192)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at ams.AMSServlet.service(AMSServlet.java:36)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:356)
    at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342)
    at org.apache.cayenne.conf.WebApplicationContextFilter.doFilter(WebApplicationContextFilter.java:91)
    at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334)
    at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1776)
    at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:514)
    at org.mortbay.http.HttpContext.handle(HttpContext.java:1726)
    at org.mortbay.http.HttpServer.service(HttpServer.java:879)
    at org.mortbay.http.HttpConnection.service(HttpConnection.java:790)
    at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:952)
    at org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)
    at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:196)
    at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
    at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:487)


Well, the only thing I was doing was setting up a select query end performing the query. I received this.

How shall someone solve this issue without having a look into cayenne's sources?
I developed quite a few frameworks for company-internal uses and I am ALWAYS checking, if all possible exceptions are correctly caught and at least giving a possible reasong for an exception. For now, I did not solve the problem but guess, there something wrong in my statement; but even if: The framework should handle this more gently telling me where the problem exactly lies.

Thanks a lot.

Jan


> Date: Mon, 19 Nov 2007 20:16:04 -0500
> Subject: Re: Deletion of obejcts
> From: kmenard@servprise.com
> To: user@cayenne.apache.org
> 
> If you're having another issue, please start a new thread and post the
> relevant code snippets and exception message.  I'll be the first to beat up
> on Cayenne's error messages, so if you can give concrete examples of where
> they fail, I'll try to get them fixed for you.
> 
> 
> On 11/19/07 7:10 PM, "Jan Lendholt" <jl...@hotmail.com> wrote:
> 
> > Thanks all for your replies. I will try that one out (deleting an iterator).
> > 
> > but, yet another problem: Ich use an object and say:
> > object.removeFromTestArray(Test);
> > Afterwards I call Test.getDataContext().commitChanges() to make these changes
> > persistent; but all I get is a "Null Objectid" exception which is yet again an
> > exception which requires a good overview over cayenne's internals; to me and
> > all my people around these error messages cayenne throws are not just a bit
> > intuitive :( 
> > 
> > _________________________________________________________________
> > Neu: Internet Explorer 7 optimiert für MSN!
> > http://optimize.de.msn.com/default.aspx?mkt=de-de
> 
> -- 
> Kevin Menard
> Servprise International, Inc.
> Remote reboot & power control for network equipment
> www.servprise.com              +1 508.892.3823 x308
> 

_________________________________________________________________
Windows Live Fotogalerie: So einfach organisieren Sie Ihre Fotos!
http://get.live.com/photogallery/overview 

Re: Deletion of obejcts

Posted by Kevin Menard <km...@servprise.com>.
If you're having another issue, please start a new thread and post the
relevant code snippets and exception message.  I'll be the first to beat up
on Cayenne's error messages, so if you can give concrete examples of where
they fail, I'll try to get them fixed for you.


On 11/19/07 7:10 PM, "Jan Lendholt" <jl...@hotmail.com> wrote:

> Thanks all for your replies. I will try that one out (deleting an iterator).
> 
> but, yet another problem: Ich use an object and say:
> object.removeFromTestArray(Test);
> Afterwards I call Test.getDataContext().commitChanges() to make these changes
> persistent; but all I get is a "Null Objectid" exception which is yet again an
> exception which requires a good overview over cayenne's internals; to me and
> all my people around these error messages cayenne throws are not just a bit
> intuitive :( 
> 
> _________________________________________________________________
> Neu: Internet Explorer 7 optimiert für MSN!
> http://optimize.de.msn.com/default.aspx?mkt=de-de

-- 
Kevin Menard
Servprise International, Inc.
Remote reboot & power control for network equipment
www.servprise.com              +1 508.892.3823 x308


RE: Deletion of obejcts

Posted by Jan Lendholt <jl...@hotmail.com>.
Thanks all for your replies. I will try that one out (deleting an iterator).

but, yet another problem: Ich use an object and say: object.removeFromTestArray(Test);
Afterwards I call Test.getDataContext().commitChanges() to make these changes persistent; but all I get is a "Null Objectid" exception which is yet again an exception which requires a good overview over cayenne's internals; to me and all my people around these error messages cayenne throws are not just a bit intuitive :( 

_________________________________________________________________
Neu: Internet Explorer 7 optimiert für MSN!
http://optimize.de.msn.com/default.aspx?mkt=de-de

Re: Deletion of obejcts

Posted by Michael Gentry <bl...@gmail.com>.
Sounds like it is just an oversight.

On Nov 19, 2007 3:38 PM, Kevin Menard <km...@servprise.com> wrote:
> This reminds me.  Is there any particular reason that DataContext has
> deleteObjects() while ObjectContext does not?
>
> --
> Kevin

RE: Deletion of obejcts

Posted by Kevin Menard <km...@servprise.com>.
This reminds me.  Is there any particular reason that DataContext has
deleteObjects() while ObjectContext does not?

-- 
Kevin

-----Original Message-----
From: Michael Gentry [mailto:blacknext@gmail.com] 
Sent: Monday, November 19, 2007 3:36 PM
To: user@cayenne.apache.org
Subject: Re: Deletion of obejcts

Hi Jan,

See if the "Deleting in an Iterator" section at:

http://cayenne.apache.org/doc/deleting-objects.html

will help you.

/dev/mrg

Re: Deletion of obejcts

Posted by Michael Gentry <bl...@gmail.com>.
Hi Jan,

See if the "Deleting in an Iterator" section at:

http://cayenne.apache.org/doc/deleting-objects.html

will help you.

/dev/mrg


On Nov 19, 2007 1:48 PM, Jan Lendholt <jl...@hotmail.com> wrote:
> Hey folks,
>
> I got pretty frustrated in the meantime with cayenne, as i think there are happing some pretty ugly thingsin cayenne's internals.
>
> At first, I again need help on deleting objects with relationships.
>
> Let's say I've got one table called "booking" with its entity Booking.
> And I've got another table extras with entity Extras.
>
> The relationship is from booking to Extras one to many (1-n entries in Extra for one booking entry).
> I've set both relationships with delete rule to nullify.
>
> Now, sime pseudo-code:
>
> Booking booking = ...;
>
> List<Extras> extras = booking.getExtrasArray();
>
> for (int i= 0;...)
> {
>     booking.getDataContext().deleteObject(extras.get(i));
>
> }
>
> commitChanges();
>
> Now, the data are deleted from the database.
> But if I do a booking.getExtrasArray(); again, it still contains the deleted objects; it seems as if they were cached or so :-/
> Even an booking.RemoveFromExtras(extras.get(i)) won't work.
>
> Hiow does the deletion work correctly? I really don't understand why cayenne won't manage that automatically, for it would be quite logic to remove deleted objects form the object graph.
>
> Well, some words about the "ugly things": We had some really strange errors coming up which are at the end quite logic, but do not help finding the problem so wen spent about 3 hours to find it.
> We deleted an entity in the modeler and recreated it. Unfortunately, there was a reference missing. So cayenne just threw an index out of bounds exception. I really don't understand such a behaviour either :/ To me, such kind of errors should be handeled and analyzed automatically by a framework, e.g. like spring does. Ok, that's it for now. Hope you still like me :-D
>
>
> Tahnks a lot in advance & kind regards form Hamburg!
>
> Jan
>
>
>
>
> _________________________________________________________________
> Importieren Sie ganz einfach Ihre E-Mail Adressen in den Messenger!
> http://messenger.live.de/community/neuekontakte_adressimport.html

RE: Deletion of obejcts

Posted by Jan Lendholt <jl...@hotmail.com>.
Hi Frederik,

thanks for your reply.

I re-checked everything; I cannot find anything wrong on my model and code.

Your assumption is correct - from From Extra to booking is 1..1.

Thanks! Jan



> Subject: RE: Deletion of obejcts
> Date: Mon, 19 Nov 2007 12:31:30 -0700
> From: fliden@translate.com
> To: user@cayenne.apache.org
> 
> Hi Jan,
> 
> Before assuming there's something wrong with the framework let's take a
> moment to consider that there may be something wrong with the code. :-)
> 
> Deletion is one feature that definitely should work as you would expect.
> Seems the reverse call is working for some reason.
> Review the relationships in the model again and make sure the generated
> objects are up-to-date. I've encountered the same problem before but
> that had to do with some incorrectlty specified obj relationships.
> 
> Btw, I'm assuming you have (1..n)from Booking to Extra. And one to one
> (1..1) from Extra to Booking.
> 
> Fredrik
> 
> 
> -----Original Message-----
> From: Jan Lendholt [mailto:jlendholt@hotmail.com] 
> Sent: Monday, November 19, 2007 11:48 AM
> To: user@cayenne.apache.org
> Subject: Deletion of obejcts
> 
> Hey folks,
> 
> I got pretty frustrated in the meantime with cayenne, as i think there
> are happing some pretty ugly thingsin cayenne's internals.
> 
> At first, I again need help on deleting objects with relationships.
> 
> Let's say I've got one table called "booking" with its entity Booking.
> And I've got another table extras with entity Extras.
> 
> The relationship is from booking to Extras one to many (1-n entries in
> Extra for one booking entry).
> I've set both relationships with delete rule to nullify.
> 
> Now, sime pseudo-code:
> 
> Booking booking = ...;
> 
> List<Extras> extras = booking.getExtrasArray();
> 
> for (int i= 0;...)
> {
>     booking.getDataContext().deleteObject(extras.get(i));
>     
> }
> 
> commitChanges();
> 
> Now, the data are deleted from the database.
> But if I do a booking.getExtrasArray(); again, it still contains the
> deleted objects; it seems as if they were cached or so :-/
> Even an booking.RemoveFromExtras(extras.get(i)) won't work.
> 
> Hiow does the deletion work correctly? I really don't understand why
> cayenne won't manage that automatically, for it would be quite logic to
> remove deleted objects form the object graph.
> 
> Well, some words about the "ugly things": We had some really strange
> errors coming up which are at the end quite logic, but do not help
> finding the problem so wen spent about 3 hours to find it.
> We deleted an entity in the modeler and recreated it. Unfortunately,
> there was a reference missing. So cayenne just threw an index out of
> bounds exception. I really don't understand such a behaviour either :/
> To me, such kind of errors should be handeled and analyzed automatically
> by a framework, e.g. like spring does. Ok, that's it for now. Hope you
> still like me :-D
> 
> 
> Tahnks a lot in advance & kind regards form Hamburg!
> 
> Jan
> 
> 
> 
> 
> _________________________________________________________________
> Importieren Sie ganz einfach Ihre E-Mail Adressen in den Messenger!
> http://messenger.live.de/community/neuekontakte_adressimport.html

_________________________________________________________________
Die neue Version vom Windows Live Messenger ist da!
http://get.live.com/messenger/overview

RE: Deletion of obejcts

Posted by Fredrik Liden <fl...@translate.com>.
Hi Jan,

Before assuming there's something wrong with the framework let's take a
moment to consider that there may be something wrong with the code. :-)

Deletion is one feature that definitely should work as you would expect.
Seems the reverse call is working for some reason.
Review the relationships in the model again and make sure the generated
objects are up-to-date. I've encountered the same problem before but
that had to do with some incorrectlty specified obj relationships.

Btw, I'm assuming you have (1..n)from Booking to Extra. And one to one
(1..1) from Extra to Booking.

Fredrik


-----Original Message-----
From: Jan Lendholt [mailto:jlendholt@hotmail.com] 
Sent: Monday, November 19, 2007 11:48 AM
To: user@cayenne.apache.org
Subject: Deletion of obejcts

Hey folks,

I got pretty frustrated in the meantime with cayenne, as i think there
are happing some pretty ugly thingsin cayenne's internals.

At first, I again need help on deleting objects with relationships.

Let's say I've got one table called "booking" with its entity Booking.
And I've got another table extras with entity Extras.

The relationship is from booking to Extras one to many (1-n entries in
Extra for one booking entry).
I've set both relationships with delete rule to nullify.

Now, sime pseudo-code:

Booking booking = ...;

List<Extras> extras = booking.getExtrasArray();

for (int i= 0;...)
{
    booking.getDataContext().deleteObject(extras.get(i));
    
}

commitChanges();

Now, the data are deleted from the database.
But if I do a booking.getExtrasArray(); again, it still contains the
deleted objects; it seems as if they were cached or so :-/
Even an booking.RemoveFromExtras(extras.get(i)) won't work.

Hiow does the deletion work correctly? I really don't understand why
cayenne won't manage that automatically, for it would be quite logic to
remove deleted objects form the object graph.

Well, some words about the "ugly things": We had some really strange
errors coming up which are at the end quite logic, but do not help
finding the problem so wen spent about 3 hours to find it.
We deleted an entity in the modeler and recreated it. Unfortunately,
there was a reference missing. So cayenne just threw an index out of
bounds exception. I really don't understand such a behaviour either :/
To me, such kind of errors should be handeled and analyzed automatically
by a framework, e.g. like spring does. Ok, that's it for now. Hope you
still like me :-D


Tahnks a lot in advance & kind regards form Hamburg!

Jan




_________________________________________________________________
Importieren Sie ganz einfach Ihre E-Mail Adressen in den Messenger!
http://messenger.live.de/community/neuekontakte_adressimport.html

Re: Deletion of obejcts

Posted by Kevin Menard <km...@servprise.com>.
Hi Jan,

On 11/19/07 1:48 PM, "Jan Lendholt" <jl...@hotmail.com> wrote:

> The relationship is from booking to Extras one to many (1-n entries in Extra
> for one booking entry).
> I've set both relationships with delete rule to nullify.

Are you sure that's correct?  It would seem to me that you would want to
cascade in one direction and do nothing in the other.  I.e., you would
probably want to delete all extras (cascade) if the Booking is deleted, but
do nothing if an Extra is deleted.

-- 
Kevin Menard
Servprise International, Inc.
Remote reboot & power control for network equipment
www.servprise.com              +1 508.892.3823 x308


Deletion of obejcts

Posted by Jan Lendholt <jl...@hotmail.com>.
Hey folks,

I got pretty frustrated in the meantime with cayenne, as i think there are happing some pretty ugly thingsin cayenne's internals.

At first, I again need help on deleting objects with relationships.

Let's say I've got one table called "booking" with its entity Booking.
And I've got another table extras with entity Extras.

The relationship is from booking to Extras one to many (1-n entries in Extra for one booking entry).
I've set both relationships with delete rule to nullify.

Now, sime pseudo-code:

Booking booking = ...;

List<Extras> extras = booking.getExtrasArray();

for (int i= 0;...)
{
    booking.getDataContext().deleteObject(extras.get(i));
    
}

commitChanges();

Now, the data are deleted from the database.
But if I do a booking.getExtrasArray(); again, it still contains the deleted objects; it seems as if they were cached or so :-/
Even an booking.RemoveFromExtras(extras.get(i)) won't work.

Hiow does the deletion work correctly? I really don't understand why cayenne won't manage that automatically, for it would be quite logic to remove deleted objects form the object graph.

Well, some words about the "ugly things": We had some really strange errors coming up which are at the end quite logic, but do not help finding the problem so wen spent about 3 hours to find it.
We deleted an entity in the modeler and recreated it. Unfortunately, there was a reference missing. So cayenne just threw an index out of bounds exception. I really don't understand such a behaviour either :/ To me, such kind of errors should be handeled and analyzed automatically by a framework, e.g. like spring does. Ok, that's it for now. Hope you still like me :-D


Tahnks a lot in advance & kind regards form Hamburg!

Jan




_________________________________________________________________
Importieren Sie ganz einfach Ihre E-Mail Adressen in den Messenger!
http://messenger.live.de/community/neuekontakte_adressimport.html

Re: Temp ID issue - Exception

Posted by Gary Jarrel <ga...@gmail.com>.
I've spent a couple of hours now trying to reproduce this error within
my code under 3.0M1 and can't seem to do it! this is rather strange!

I'll keep trying, once I get anywhere with it I'll post it here!

Gary

On 9/25/07, Gary Jarrel <ga...@gmail.com> wrote:
> I will reconfigure the app to use 3.0M1 tonight and post the stack trace,
>
> Sorry for delay!
>
> On 9/22/07, Andrus Adamchik <an...@objectstyle.org> wrote:
> > A few more questions.
> >
> > Could you provide a more complete stack trace (just include the
> > entire Cayenne part of the stack), as I am wondering where in the
> > Cayenne code the failing query is fired?
> >
>

Re: Raw XML vs. Cayenne GUI

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Chris,

I don't think anything you said warrants starting a flame war :-) GUI  
tools and text editors are not mutually exclusive. Where the Cayenne  
philosophy may have played out is in the lack of interest in  
documenting the XML format by the developers. But lack of interest  
not equals opposing the idea. I am all for taking the DTD, and  
creating a chapter in the user guide called "Cayenne XML Format" or  
something and/or providing XML snippets next to the GUI screenshots  
throughout the docs. If anybody is willing to participate in this  
effort (even if they are not current committers), let us know - we  
can arrange access to the documentation Wiki.

Thanks
Andrus



On Sep 26, 2007, at 2:57 AM, Chris Farnham wrote:

> I've been using Cayenne on two different projects for a couple of  
> months
> now and am very happy with it.
>
> One thing that I don't like is the reliance upon a graphical composer
> rather than a well documented and defined descriptor file.  I know  
> that
> the Cayenne community views the GUI tool as an important  
> differentiator
> from other ORM frameworks.  But not everyone likes to work with GUI
> tools.  Perhaps it's my Unix roots.
>
> I prefer working directly with Cayenne's XML descriptor.  I wish that
> the schema was documented beyond just a DTD and snippets that people
> pass around on this list.  I also get frustrated when I find
> documentation which explains how to control caching or custom queries
> and all it has are step-by-step screenshots of the GUI tool.
>
> I know that the GUI tool is part of the Cayenne philosophy and I am  
> wary
> of starting a flame-war (perhaps this discussion was happened on this
> list in times past and I haven't seen it).
>
> Do other people feel the same way I do?
> If so, can Cayenne better support both modes of use?
>
> I would like to see documentation and examples that are XML descriptor
> centric as well as GUI centric.
>
> I also think that it'd be an interesting project to look at the  
> current
> XML syntax and make it a little more user/text-editor friendly.  I  
> have
> no concrete ideas on this latter point but I've been playing around  
> with
> DSLs in other areas and it might be neat to either streamline  
> Cayenne's
> XML syntax or create a DSL.  Either of these could be transformed into
> the current XML syntax.
>
> I only raise this issue because I've enjoyed using Cayenne and would
> like to see it improve.
>
> Thanks,
> Chris Farnham
>
> cfarnham@cra.com
>
>
>
>
> THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS  
> ADDRESSED. IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED,  
> CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If  
> you are not the intended recipient, your use of this message for  
> any purpose is strictly prohibited. If you have received this  
> communication in error, please delete the message and notify the  
> sender so that we may correct our records.
>


Re: Raw XML vs. Cayenne GUI

Posted by Mikaël Cluseau <mi...@isinc.dyndns.org>.
You may be interested in the "Modifying projects in Java" thread of last
july.

Le mardi 25 septembre 2007 à 19:57 -0400, Chris Farnham a écrit :
> I've been using Cayenne on two different projects for a couple of months
> now and am very happy with it.
> 
> One thing that I don't like is the reliance upon a graphical composer
> rather than a well documented and defined descriptor file.  I know that
> the Cayenne community views the GUI tool as an important differentiator
> from other ORM frameworks.  But not everyone likes to work with GUI
> tools.  Perhaps it's my Unix roots.
> 
> I prefer working directly with Cayenne's XML descriptor.  I wish that
> the schema was documented beyond just a DTD and snippets that people
> pass around on this list.  I also get frustrated when I find
> documentation which explains how to control caching or custom queries
> and all it has are step-by-step screenshots of the GUI tool.
> 
> I know that the GUI tool is part of the Cayenne philosophy and I am wary
> of starting a flame-war (perhaps this discussion was happened on this
> list in times past and I haven't seen it).
> 
> Do other people feel the same way I do?
> If so, can Cayenne better support both modes of use?
> 
> I would like to see documentation and examples that are XML descriptor
> centric as well as GUI centric.  
> 
> I also think that it'd be an interesting project to look at the current
> XML syntax and make it a little more user/text-editor friendly.  I have
> no concrete ideas on this latter point but I've been playing around with
> DSLs in other areas and it might be neat to either streamline Cayenne's
> XML syntax or create a DSL.  Either of these could be transformed into
> the current XML syntax.
> 
> I only raise this issue because I've enjoyed using Cayenne and would
> like to see it improve.
> 
> Thanks,
> Chris Farnham
> 
> cfarnham@cra.com
>  
> 
> 
> 
> THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If you are not the intended recipient, your use of this message for any purpose is strictly prohibited. If you have received this communication in error, please delete the message and notify the sender so that we may correct our records.
-- 
Mikaël Cluseau <mc...@gmail.com>
ISI.NC

Fwd: Raw XML vs. Cayenne GUI

Posted by Andrus Adamchik <an...@objectstyle.org>.
FYI:

As Chris followed up on his suggestion to start working on a Wiki  
page describing Cayenne XML format, I added Chris to "cayenne-user"  
Wiki group and I made some permission changes in the CAY space,  
allowing "cayenne-user" to edit the space. Note that since we do not  
include the contents of this space in the release, this is the only  
space where users without a CLA on file may be allowed. But of course  
if we are to transfer the contents to CAYDOC, we'll need a CLA.

Andrus


Begin forwarded message:

> From: "Chris Farnham" <cf...@cra.com>
> Date: September 26, 2007 4:42:22 PM GMT+03:00
> To: <us...@cayenne.apache.org>
> Subject: RE: Raw XML vs. Cayenne GUI
> Reply-To: user@cayenne.apache.org
>
>> Such a thing would probably help other people and improve the
>> usability of Cayenne. Perhaps you'd like to start a page here:
>>
>> http://cwiki.apache.org/CAY/
>>
>> Eventually this could be merged into the main documentation.
>
> In the next day or two I'll add a Wiki page as suggested.  I expect it
> will be a strawman as much as anything.
>
>
> Thanks,
> Chris
>
>
>
>
>
>
>
> THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS  
> ADDRESSED. IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED,  
> CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If  
> you are not the intended recipient, your use of this message for  
> any purpose is strictly prohibited. If you have received this  
> communication in error, please delete the message and notify the  
> sender so that we may correct our records.
>
>
>
>
> From: Aristedes Maniatis [mailto:ari@maniatis.org]
> Sent: Wednesday, September 26, 2007 5:24 AM
> To: user@cayenne.apache.org
> Subject: Re: Raw XML vs. Cayenne GUI
>
>
> On 26/09/2007, at 9:57 AM, Chris Farnham wrote:
>
>> Do other people feel the same way I do?
>> If so, can Cayenne better support both modes of use?
>
> Sure.
>
>> I would like to see documentation and examples that are XML  
>> descriptor
>> centric as well as GUI centric.
>
> I think that would be useful to a number of people.
>
>> I also think that it'd be an interesting project to look at the
>> current
>> XML syntax and make it a little more user/text-editor friendly.  I
>> have
>> no concrete ideas on this latter point but I've been playing around
>> with
>> DSLs in other areas and it might be neat to either streamline
>> Cayenne's
>> XML syntax or create a DSL.  Either of these could be transformed  
>> into
>> the current XML syntax.
>
> The advantage of XML is that there are any number of ways to author
> the content.
>
>> I only raise this issue because I've enjoyed using Cayenne and would
>> like to see it improve.
>
> Such a thing would probably help other people and improve the
> usability of Cayenne. Perhaps you'd like to start a page here:
>
> http://cwiki.apache.org/CAY/
>
> Eventually this could be merged into the main documentation.
>
>
>
> Ari Maniatis
>
>
>
> -------------------------->
> Aristedes Maniatis
> phone +61 2 9660 9700
> PGP fingerprint 08 57 20 4B 80 69 59 E2  A9 BF 2D 48 C2 20 0C C8
>


RE: Raw XML vs. Cayenne GUI

Posted by Chris Farnham <cf...@cra.com>.
> Such a thing would probably help other people and improve the  
> usability of Cayenne. Perhaps you'd like to start a page here:
>
> http://cwiki.apache.org/CAY/
>
> Eventually this could be merged into the main documentation.

In the next day or two I'll add a Wiki page as suggested.  I expect it
will be a strawman as much as anything.


Thanks,
Chris



 
 
 
 
THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If you are not the intended recipient, your use of this message for any purpose is strictly prohibited. If you have received this communication in error, please delete the message and notify the sender so that we may correct our records.
 
 
 

From: Aristedes Maniatis [mailto:ari@maniatis.org] 
Sent: Wednesday, September 26, 2007 5:24 AM
To: user@cayenne.apache.org
Subject: Re: Raw XML vs. Cayenne GUI


On 26/09/2007, at 9:57 AM, Chris Farnham wrote:

> Do other people feel the same way I do?
> If so, can Cayenne better support both modes of use?

Sure.

> I would like to see documentation and examples that are XML descriptor
> centric as well as GUI centric.

I think that would be useful to a number of people.

> I also think that it'd be an interesting project to look at the  
> current
> XML syntax and make it a little more user/text-editor friendly.  I  
> have
> no concrete ideas on this latter point but I've been playing around  
> with
> DSLs in other areas and it might be neat to either streamline  
> Cayenne's
> XML syntax or create a DSL.  Either of these could be transformed into
> the current XML syntax.

The advantage of XML is that there are any number of ways to author  
the content.

> I only raise this issue because I've enjoyed using Cayenne and would
> like to see it improve.

Such a thing would probably help other people and improve the  
usability of Cayenne. Perhaps you'd like to start a page here:

http://cwiki.apache.org/CAY/

Eventually this could be merged into the main documentation.



Ari Maniatis



-------------------------->
Aristedes Maniatis
phone +61 2 9660 9700
PGP fingerprint 08 57 20 4B 80 69 59 E2  A9 BF 2D 48 C2 20 0C C8

Re: Raw XML vs. Cayenne GUI

Posted by Aristedes Maniatis <ar...@maniatis.org>.
On 26/09/2007, at 9:57 AM, Chris Farnham wrote:

> Do other people feel the same way I do?
> If so, can Cayenne better support both modes of use?

Sure.

> I would like to see documentation and examples that are XML descriptor
> centric as well as GUI centric.

I think that would be useful to a number of people.

> I also think that it'd be an interesting project to look at the  
> current
> XML syntax and make it a little more user/text-editor friendly.  I  
> have
> no concrete ideas on this latter point but I've been playing around  
> with
> DSLs in other areas and it might be neat to either streamline  
> Cayenne's
> XML syntax or create a DSL.  Either of these could be transformed into
> the current XML syntax.

The advantage of XML is that there are any number of ways to author  
the content.

> I only raise this issue because I've enjoyed using Cayenne and would
> like to see it improve.

Such a thing would probably help other people and improve the  
usability of Cayenne. Perhaps you'd like to start a page here:

http://cwiki.apache.org/CAY/

Eventually this could be merged into the main documentation.



Ari Maniatis



-------------------------->
Aristedes Maniatis
phone +61 2 9660 9700
PGP fingerprint 08 57 20 4B 80 69 59 E2  A9 BF 2D 48 C2 20 0C C8



Raw XML vs. Cayenne GUI

Posted by Chris Farnham <cf...@cra.com>.
I've been using Cayenne on two different projects for a couple of months
now and am very happy with it.

One thing that I don't like is the reliance upon a graphical composer
rather than a well documented and defined descriptor file.  I know that
the Cayenne community views the GUI tool as an important differentiator
from other ORM frameworks.  But not everyone likes to work with GUI
tools.  Perhaps it's my Unix roots.

I prefer working directly with Cayenne's XML descriptor.  I wish that
the schema was documented beyond just a DTD and snippets that people
pass around on this list.  I also get frustrated when I find
documentation which explains how to control caching or custom queries
and all it has are step-by-step screenshots of the GUI tool.

I know that the GUI tool is part of the Cayenne philosophy and I am wary
of starting a flame-war (perhaps this discussion was happened on this
list in times past and I haven't seen it).

Do other people feel the same way I do?
If so, can Cayenne better support both modes of use?

I would like to see documentation and examples that are XML descriptor
centric as well as GUI centric.  

I also think that it'd be an interesting project to look at the current
XML syntax and make it a little more user/text-editor friendly.  I have
no concrete ideas on this latter point but I've been playing around with
DSLs in other areas and it might be neat to either streamline Cayenne's
XML syntax or create a DSL.  Either of these could be transformed into
the current XML syntax.

I only raise this issue because I've enjoyed using Cayenne and would
like to see it improve.

Thanks,
Chris Farnham

cfarnham@cra.com
 
 
 
 
THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If you are not the intended recipient, your use of this message for any purpose is strictly prohibited. If you have received this communication in error, please delete the message and notify the sender so that we may correct our records.

Re: Temp ID issue - Exception

Posted by Andrus Adamchik <an...@objectstyle.org>.
Thanks for the info. Looks like it was fixed in August as a part of  
another bugfix, and will be released in M2:

~/work/cayenne: svn diff framework/cayenne-jdk1.4-unpublished/src/ 
main/java/org/apache/cayenne/map/AshwoodEntitySorter.java -r  
551302:565900
Index: framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/ 
cayenne/map/AshwoodEntitySorter.java
===================================================================
--- framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/ 
cayenne/map/AshwoodEntitySorter.java  (revision 551302)
+++ framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/ 
cayenne/map/AshwoodEntitySorter.java  (revision 565900)
@@ -302,16 +302,22 @@
          // find committed snapshot - so we can't fetch from the  
context as it will return
          // dirty snapshot; must go down the stack instead
+
+        // how do we handle this for NEW objects correctly? For now  
bail from the method
+        if (object.getObjectId().isTemporary()) {
+            return null;
+        }
+
          ObjectIdQuery query = new ObjectIdQuery(
                  object.getObjectId(),
                  true,
                  ObjectIdQuery.CACHE);
          QueryResponse response = context.getChannel().onQuery(null,  
query);
          List result = response.firstList();
-        if(result == null || result.size() == 0) {
+        if (result == null || result.size() == 0) {
              return null;
          }
-
+
          DataRow snapshot = (DataRow) result.get(0);
          ObjectId id = snapshot.createTargetObjectId 
(targetEntityName, finalRel);


Andrus

On Sep 27, 2007, at 4:04 AM, Gary Jarrel wrote:

> Although not able to reproduce was able to pull it out one of the  
> log files:
>
> ERROR au.com.jarrel.katya.proc.db.dao.CayenneDataContextInterceptor
> (CayenneDataContextInterceptor.java:49) - Caught exception during
> invocation, will try to roll back
> org.apache.cayenne.CayenneRuntimeException: [v.3.0M1 Jul 27 2007
> 23:05:47] Can't build a query for temporary id:
> <ObjectId:Notification, TEMP:0000034FCA0C0101>
> 	at org.apache.cayenne.query.ObjectIdQuery.createReplacementQuery 
> (ObjectIdQuery.java:120)
> 	at org.apache.cayenne.query.IndirectQuery.getReplacementQuery 
> (IndirectQuery.java:75)
> 	at org.apache.cayenne.query.IndirectQuery.route(IndirectQuery.java: 
> 58)
> 	at org.apache.cayenne.access.DataDomainQueryAction.runQuery 
> (DataDomainQueryAction.java:408)
> 	at org.apache.cayenne.access.DataDomainQueryAction.access$000 
> (DataDomainQueryAction.java:65)
> 	at org.apache.cayenne.access.DataDomainQueryAction$2.transform 
> (DataDomainQueryAction.java:389)
> 	at org.apache.cayenne.access.DataDomain.runInTransaction 
> (DataDomain.java:802)
> 	at  
> org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction( 
> DataDomainQueryAction.java:386)
> 	at  
> org.apache.cayenne.access.DataDomainQueryAction.interceptOIDQuery 
> (DataDomainQueryAction.java:159)
> 	at org.apache.cayenne.access.DataDomainQueryAction.execute 
> (DataDomainQueryAction.java:112)
> 	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:722)
> 	at org.apache.cayenne.map.AshwoodEntitySorter.findReflexiveMaster 
> (AshwoodEntitySorter.java:309)
> 	at org.apache.cayenne.map.AshwoodEntitySorter.sortObjectsForEntity 
> (AshwoodEntitySorter.java:201)
> 	at  
> org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal 
> (DataDomainInsertBucket.java:86)
> 	at org.apache.cayenne.access.DataDomainSyncBucket.appendQueries 
> (DataDomainSyncBucket.java:75)
> 	at org.apache.cayenne.access.DataDomainFlushAction.preprocess 
> (DataDomainFlushAction.java:181)
> 	at org.apache.cayenne.access.DataDomainFlushAction.flush 
> (DataDomainFlushAction.java:133)
> 	at org.apache.cayenne.access.DataDomain.onSyncFlush 
> (DataDomain.java:786)
> 	at org.apache.cayenne.access.DataDomain$2.transform 
> (DataDomain.java:757)
> 	at org.apache.cayenne.access.DataDomain.runInTransaction 
> (DataDomain.java:812)
> 	at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:754)
> 	at org.apache.cayenne.access.DataContext.flushToParent 
> (DataContext.java:1157)
> 	at org.apache.cayenne.access.DataContext.commitChanges 
> (DataContext.java:1062)
> 	at au.com.jarrel.katya.proc.db.dao.impl.BaseDaoImpl.commit 
> (BaseDaoImpl.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at  
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio 
> n(AopUtils.java:296)
> 	at  
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi 
> npoint(ReflectiveMethodInvocation.java:177)
> 	at  
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed 
> (ReflectiveMethodInvocation.java:144)
> 	at  
> au.com.jarrel.katya.proc.db.dao.CayenneDataContextInterceptor.invoke 
> (CayenneDataContextInterceptor.java:46)
> 	at  
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed 
> (ReflectiveMethodInvocation.java:166)
> 	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke 
> (JdkDynamicAopProxy.java:204)
> 	at $Proxy12.commit(Unknown Source)
> 	at  
> au.com.jarrel.katya.proc.mail.pipeline.command.NotificationSendingComm 
> and.sendAndSaveEmailNotification(NotificationSendingCommand.java:181)
> 	at  
> au.com.jarrel.katya.proc.mail.pipeline.command.NotificationSendingComm 
> and.sendNotification(NotificationSendingCommand.java:59)
> 	at  
> au.com.jarrel.katya.proc.mail.pipeline.command.NotificationSendingComm 
> and.sendNotifications(NotificationSendingCommand.java:53)
> 	at  
> au.com.jarrel.katya.proc.mail.pipeline.command.NotificationSendingComm 
> and.execute(NotificationSendingCommand.java:46)
> 	at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java: 
> 190)
> 	at au.com.jarrel.katya.proc.mail.pipeline.SpringPipelineRunner.run 
> (SpringPipelineRunner.java:43)
> 	at au.com.jarrel.katya.james.mailet.PipelineProcessor.service 
> (PipelineProcessor.java:30)
> 	at org.apache.james.transport.LinearProcessor.service 
> (LinearProcessor.java:424)
> 	at org.apache.james.transport.JamesSpoolManager.process 
> (JamesSpoolManager.java:405)
> 	at org.apache.james.transport.JamesSpoolManager.run 
> (JamesSpoolManager.java:309)
> 	at java.lang.Thread.run(Thread.java:595)
>
>
> Hope this is of some value!
>
> Gary
>
> On 9/25/07, Gary Jarrel <ga...@gmail.com> wrote:
>> I will reconfigure the app to use 3.0M1 tonight and post the stack  
>> trace,
>>
>> Sorry for delay!
>>
>> On 9/22/07, Andrus Adamchik <an...@objectstyle.org> wrote:
>>> A few more questions.
>>>
>>> Could you provide a more complete stack trace (just include the
>>> entire Cayenne part of the stack), as I am wondering where in the
>>> Cayenne code the failing query is fired?
>>>
>>
>


Re: Temp ID issue - Exception

Posted by Gary Jarrel <ga...@gmail.com>.
Although not able to reproduce was able to pull it out one of the log files:

ERROR au.com.jarrel.katya.proc.db.dao.CayenneDataContextInterceptor
(CayenneDataContextInterceptor.java:49) - Caught exception during
invocation, will try to roll back
org.apache.cayenne.CayenneRuntimeException: [v.3.0M1 Jul 27 2007
23:05:47] Can't build a query for temporary id:
<ObjectId:Notification, TEMP:0000034FCA0C0101>
	at org.apache.cayenne.query.ObjectIdQuery.createReplacementQuery(ObjectIdQuery.java:120)
	at org.apache.cayenne.query.IndirectQuery.getReplacementQuery(IndirectQuery.java:75)
	at org.apache.cayenne.query.IndirectQuery.route(IndirectQuery.java:58)
	at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:408)
	at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:65)
	at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:389)
	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:802)
	at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:386)
	at org.apache.cayenne.access.DataDomainQueryAction.interceptOIDQuery(DataDomainQueryAction.java:159)
	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:112)
	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:722)
	at org.apache.cayenne.map.AshwoodEntitySorter.findReflexiveMaster(AshwoodEntitySorter.java:309)
	at org.apache.cayenne.map.AshwoodEntitySorter.sortObjectsForEntity(AshwoodEntitySorter.java:201)
	at org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:86)
	at org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:75)
	at org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:181)
	at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:133)
	at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:786)
	at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:757)
	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:812)
	at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:754)
	at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1157)
	at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1062)
	at au.com.jarrel.katya.proc.db.dao.impl.BaseDaoImpl.commit(BaseDaoImpl.java:89)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
	at au.com.jarrel.katya.proc.db.dao.CayenneDataContextInterceptor.invoke(CayenneDataContextInterceptor.java:46)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
	at $Proxy12.commit(Unknown Source)
	at au.com.jarrel.katya.proc.mail.pipeline.command.NotificationSendingCommand.sendAndSaveEmailNotification(NotificationSendingCommand.java:181)
	at au.com.jarrel.katya.proc.mail.pipeline.command.NotificationSendingCommand.sendNotification(NotificationSendingCommand.java:59)
	at au.com.jarrel.katya.proc.mail.pipeline.command.NotificationSendingCommand.sendNotifications(NotificationSendingCommand.java:53)
	at au.com.jarrel.katya.proc.mail.pipeline.command.NotificationSendingCommand.execute(NotificationSendingCommand.java:46)
	at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
	at au.com.jarrel.katya.proc.mail.pipeline.SpringPipelineRunner.run(SpringPipelineRunner.java:43)
	at au.com.jarrel.katya.james.mailet.PipelineProcessor.service(PipelineProcessor.java:30)
	at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:424)
	at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:405)
	at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:309)
	at java.lang.Thread.run(Thread.java:595)


Hope this is of some value!

Gary

On 9/25/07, Gary Jarrel <ga...@gmail.com> wrote:
> I will reconfigure the app to use 3.0M1 tonight and post the stack trace,
>
> Sorry for delay!
>
> On 9/22/07, Andrus Adamchik <an...@objectstyle.org> wrote:
> > A few more questions.
> >
> > Could you provide a more complete stack trace (just include the
> > entire Cayenne part of the stack), as I am wondering where in the
> > Cayenne code the failing query is fired?
> >
>

Re: Temp ID issue - Exception

Posted by Gary Jarrel <ga...@gmail.com>.
I will reconfigure the app to use 3.0M1 tonight and post the stack trace,

Sorry for delay!

On 9/22/07, Andrus Adamchik <an...@objectstyle.org> wrote:
> A few more questions.
>
> Could you provide a more complete stack trace (just include the
> entire Cayenne part of the stack), as I am wondering where in the
> Cayenne code the failing query is fired?
>

Re: Temp ID issue - Exception

Posted by Andrus Adamchik <an...@objectstyle.org>.
A few more questions.

Could you provide a more complete stack trace (just include the  
entire Cayenne part of the stack), as I am wondering where in the  
Cayenne code the failing query is fired?

Does it happen every time when a user request hits the code in  
question, or is it sporadic? (I am testing a theory that it has  
something to do with 3.0 weak references to the registered objects in  
DataContext).

Thanks
Andrus


On Sep 20, 2007, at 1:11 PM, Gary Jarrel wrote:

>>> Any thoughts on what could be causing this during commit?
>>>
>>> org.apache.cayenne.CayenneRuntimeException: [v.3.0M1 Jul 27 2007
>>> 23:05:47] Can't build a query for temporary id:
>>> <ObjectId:CorrespondenceRecepientNotification, TEMP: 
>>> 0000032DC4F40101>
>>>         at
>>> org.apache.cayenne.query.ObjectIdQuery.createReplacementQuery
>>> (ObjectIdQuery.java:120)
>>>         at
>>> org.apache.cayenne.query.IndirectQuery.getReplacementQuery
>>> (IndirectQuery.java:75)
>>>         at org.apache.cayenne.query.IndirectQuery.route
>>> (IndirectQuery.java:58)
>>>         at org.apache.cayenne.access.DataDomainQueryAction.runQuery
>>> (DataDomainQueryAction.java:
>>> <snip>


Re: Temp ID issue - Exception

Posted by Gary Jarrel <ga...@gmail.com>.
Hi,

Evidently this is only an 3.0M1 problem, as I've just switched back to
2.0.3 and the problem disappeared!

I can't paste the actual code due to NDA reasons of this project,
however the modified version looks something like this:

public void createAndSaveNotification() {
	//find the existing mail record in the database
	IMaintenanceRequest req = getDao().findMaintenanceRequestRecord(corId);

	//create a new notification record
	INotification notification = getDao().createAndRegisterNotification();

	notification.setDateSent(KatyaUtil.getCalendarInGmtTimeZone().getTime());
	notification.setType(INotification.TYPE_IM);

	//req.addToNotificationArray(notification);
	notification.setToCorrespondence(req);

        logObjects();

	getDao().commit();
}

I use the DAO to find the record for which notification will be
created. Then I use the DAO to create and register a new instance of
the notification object. Set some fields on it like date sent and
type. The try to build a relationship and commit back to the DB.

the logObjects method logs all the uncommitted objects from the data
context. When I check the log there are 2 objects being logged, one
being the maintenance request record in modified state, and one being
the notification record in the new state.

And at the commit level I get the exception I wrote about. Didn't
think there was anything to complicated about this. And as I said
above I reverted back to 2.0.3 and it works fine, but in 3.0M1 it
throws an exception.

Any thoughts?

Thank you!

Gary

On 9/19/07, Tore Halset <ha...@pvv.ntnu.no> wrote:
> Hello.
>
> Looks like you are using an uncomitted new object in a query. Could
> you post your relevant java code?
>
>   - Tore.
>
> On Sep 19, 2007, at 12:12 , Gary Jarrel wrote:
>
> > Hi Guys!
> >
> > Any thoughts on what could be causing this during commit?
> >
> > org.apache.cayenne.CayenneRuntimeException: [v.3.0M1 Jul 27 2007
> > 23:05:47] Can't build a query for temporary id:
> > <ObjectId:CorrespondenceRecepientNotification, TEMP:0000032DC4F40101>
> >         at
> > org.apache.cayenne.query.ObjectIdQuery.createReplacementQuery
> > (ObjectIdQuery.java:120)
> >         at
> > org.apache.cayenne.query.IndirectQuery.getReplacementQuery
> > (IndirectQuery.java:75)
> >         at org.apache.cayenne.query.IndirectQuery.route
> > (IndirectQuery.java:58)
> >         at org.apache.cayenne.access.DataDomainQueryAction.runQuery
> > (DataDomainQueryAction.java:
> > <snip>
> >
> > I've did some googling and came across similar errors, all which
> > related to version 1.2 of Cayenne and all appear to have been resolved
> > based on the Jira issues which I read?
> >
> > Thank you!
> >
> > Gary
> >
>
>

Re: Temp ID issue - Exception

Posted by Tore Halset <ha...@pvv.ntnu.no>.
Hello.

Looks like you are using an uncomitted new object in a query. Could  
you post your relevant java code?

  - Tore.

On Sep 19, 2007, at 12:12 , Gary Jarrel wrote:

> Hi Guys!
>
> Any thoughts on what could be causing this during commit?
>
> org.apache.cayenne.CayenneRuntimeException: [v.3.0M1 Jul 27 2007
> 23:05:47] Can't build a query for temporary id:
> <ObjectId:CorrespondenceRecepientNotification, TEMP:0000032DC4F40101>
>         at  
> org.apache.cayenne.query.ObjectIdQuery.createReplacementQuery 
> (ObjectIdQuery.java:120)
>         at  
> org.apache.cayenne.query.IndirectQuery.getReplacementQuery 
> (IndirectQuery.java:75)
>         at org.apache.cayenne.query.IndirectQuery.route 
> (IndirectQuery.java:58)
>         at org.apache.cayenne.access.DataDomainQueryAction.runQuery 
> (DataDomainQueryAction.java:
> <snip>
>
> I've did some googling and came across similar errors, all which
> related to version 1.2 of Cayenne and all appear to have been resolved
> based on the Jira issues which I read?
>
> Thank you!
>
> Gary
>