ORM Errors are giving session closed instead of the correct error.

For example in ColdBox this code generate a session closed error.

var comment = ORMService.new(‘Comment’);

comment.setPosted(now());

ORMService.save(comment);

However when I run this outside of ColdBox in a normal Application I am getting the correct error.

myComment = new Comment();

myComment.setPosted(now());

entitySave(myComment);

Which is “not-null property references a null or transient value: blogComment.Entry”, and I think that this really needs to be addressed because we need to take care of the right condition for the right problem. Session Closed means nothing and we can’t cater for this error, because it means nothing to us.

Regards,

Andrew Scott

http://www.andyscott.id.au/

Out of curiosity, are you using CF 9 or CF 9.0.1? Adobe changed the
behavior of session closing with the updater. I don't know if this has
anything to do with this particular problem but it may help
troubleshoot things.

Judah

It shouldn't matter what version of ColdFusion I am using, as both examples
where tested against the same version of ColdFusion.

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Judah McAuley
Sent: Sunday, 10 October 2010 2:57 PM
To: coldbox@googlegroups.com
Subject: Re: [coldbox:6156] ORM Errors are giving session closed instead

of

the correct error.

Out of curiosity, are you using CF 9 or CF 9.0.1? Adobe changed the

behavior

of session closing with the updater. I don't know if this has anything to

do

Yes, I understand that both examples were tested against the same
version. I was just asking which version because, as I pointed out,
the session closing behavior changed from 9 to 9.0.1 If the message
about session closing happens in, say, 9.0.1 but not 9 then that will
help track down where the fix needs to go in. Full information about
your environment is helpful for tracking down errors.

Cheers,
Judah

Judah, it doesn't matter what version of ColdFusion I am running. Outside of
ColdBox I get the correct error, inside of ColdBox I get a session closed. I
actually know what the error is that is causing this and have fixed it, the
problem is that Luis will need to patch this because it is a problem in
ColdBox.

I understand what you are trying to do and I appreciate it, but when I say
it doesn't matter what version of ColdFusion I am running and tell you that
both examples where on the same version of ColdFusion is enough to tell
anyone that there is a bug in ColdBox itself.

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Judah McAuley
Sent: Sunday, 10 October 2010 3:16 PM
To: coldbox@googlegroups.com
Subject: Re: [coldbox:6159] ORM Errors are giving session closed instead

of

the correct error.

Yes, I understand that both examples were tested against the same version.
I was just asking which version because, as I pointed out, the session

closing

behavior changed from 9 to 9.0.1 If the message about session closing
happens in, say, 9.0.1 but not 9 then that will help track down where the

fix

Andrew, reporting what version of Coldfusion the error is occurring
under is a basic part of bug reporting. We need to reproduce the error
in order to be able to verify that it is fixed. Part of that is
knowing which version this error is happening under. I'm not saying
that the problem isn't with Coldbox, but if you want it fixed, it
helps to have a full understanding of where the problem is arising.

Judah

Judah, I gave the code to produce it. You don't need to tell me how to
report bugs, I was a testing Manager for a very large games company so I am
well and truly aware of the process. If it is applicable it is reported.

If I thought that it was reliant on what version of ColdFusion it was
running on I would have reported that, and as the examples I gave worked in
standard ColdFusion code and not in ColdBox told me it was a ColdBox error.
And any 3 year old will tell you that the code is not reliant on what
version of ColdFusion ColdBox is running on.

And before I even posted here I removed the ORMService.save(entity) and
replaced it with EntitySave() and got what I was supposed to get as an
error, replaced it back with ORMService.save() and I get session closed.

The code I gave was very straight forward and I hate to say this because it
will mean I am being an arsshole, but to be honest and 3 year old can work
out what the problem is. ORMSerivce.save() has a bug that it closes the
session. And after introspecting the code I see what the problem is and have
fixed my local copy.

Sorry to sound harsh here Judah but I appreciate your help, but your
questions are not needed in this example. As it is clear cut what the
problem is if anyone actually bothered to run the code. Please don't take my
rant the wrong way, I am tired of people coming back with a statement, that
in this case was very simple to work out how to find. And then not accepting
that I might have already tried many things before coming to this list, and
I tell you this that before I even do come to this list I have run a line
debugger over the code to see what is happening. I knew it was ColdBox and
not ColdFusion before even posting here, I just didn't know until after I
posted how to actually fix it.

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Judah McAuley
Sent: Sunday, 10 October 2010 3:31 PM
To: coldbox@googlegroups.com
Subject: Re: [coldbox:6162] ORM Errors are giving session closed instead

of

the correct error.

Andrew, reporting what version of Coldfusion the error is occurring under

is a

basic part of bug reporting. We need to reproduce the error in order to be
able to verify that it is fixed. Part of that is knowing which version

this error is

happening under. I'm not saying that the problem isn't with Coldbox, but

if

you want it fixed, it helps to have a full understanding of where the

problem

Andrew,

I would encourage you to re-read this message thread at a later date.

Judah asked a simple question politely that you could have answered in
the interest of cooperation without wasting everybody's time.

I'm new to this community and was interested in this thread and your
problem. Just because your problem didn't happen to relate to the
version of CF you were using doesn't mean that it wasn't a reasonable
question.

I would hope that in the future you will be more respectful of the
time and effort from unpaid members of this and other communities who
are trying to help.

Just my 2 cents

On a related note, would you be willing to document your fix so that
the bug can be fixed for others? I'm sure it would be appreciated.

-ben

Ben, the point I am making if you read my post is that it didn't matter what
version of ColdFusion I was running under. There was a bug found in the way
ColdBox uses the ORMService.save() and by saying it doesn't matter is me
saying that it doesn't matter. And one can come back and argue that point
continuously but it stands that it didn't matter.

As for the fix, remove the transaction around the entitySave in the save
method of the ORMService.save().

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Ben Dalton
Sent: Sunday, 10 October 2010 3:57 PM
To: coldbox@googlegroups.com
Subject: Re: [coldbox:6165] ORM Errors are giving session closed instead

of

the correct error.

Andrew,

I would encourage you to re-read this message thread at a later date.

Judah asked a simple question politely that you could have answered in the
interest of cooperation without wasting everybody's time.

I'm new to this community and was interested in this thread and your
problem. Just because your problem didn't happen to relate to the version

of

CF you were using doesn't mean that it wasn't a reasonable question.

I would hope that in the future you will be more respectful of the time

and

effort from unpaid members of this and other communities who are trying to
help.

Just my 2 cents

On a related note, would you be willing to document your fix so that the

bug

can be fixed for others? I'm sure it would be appreciated.

-ben

> Judah, I gave the code to produce it. You don't need to tell me how to
> report bugs, I was a testing Manager for a very large games company so
> I am well and truly aware of the process. If it is applicable it is

reported.

>
> If I thought that it was reliant on what version of ColdFusion it was
> running on I would have reported that, and as the examples I gave
> worked in standard ColdFusion code and not in ColdBox told me it was a
ColdBox error.
> And any 3 year old will tell you that the code is not reliant on what
> version of ColdFusion ColdBox is running on.
>
> And before I even posted here I removed the ORMService.save(entity)
> and replaced it with EntitySave() and got what I was supposed to get
> as an error, replaced it back with ORMService.save() and I get session
closed.
>
> The code I gave was very straight forward and I hate to say this
> because it will mean I am being an arsshole, but to be honest and 3
> year old can work out what the problem is. ORMSerivce.save() has a bug
> that it closes the session. And after introspecting the code I see
> what the problem is and have fixed my local copy.
>
> Sorry to sound harsh here Judah but I appreciate your help, but your
> questions are not needed in this example. As it is clear cut what the
> problem is if anyone actually bothered to run the code. Please don't
> take my rant the wrong way, I am tired of people coming back with a
> statement, that in this case was very simple to work out how to find.
> And then not accepting that I might have already tried many things
> before coming to this list, and I tell you this that before I even do
> come to this list I have run a line debugger over the code to see what
> is happening. I knew it was ColdBox and not ColdFusion before even
> posting here, I just didn't know until after I posted how to actually

fix it.

Andrew, I remember having a similar issue recently. And, because I'm
short on sleep, don't understand why that fixed it (not in front if
code too).

Could you elaborate? Are there multiple transaction? Thanks.

Aaron Greenlee

http://aarongreenlee.com/
Twitter: aarongreenlee

No Aaron it was a single save of a created entity, the transaction code is
wrapped around the EntitySave which seems strange to me, inside the save
method of the ORMService.

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Aaron Greenlee
Sent: Monday, 11 October 2010 12:39 AM
To: coldbox@googlegroups.com
Subject: Re: [coldbox:6170] ORM Errors are giving session closed instead

of

the correct error.

Andrew, I remember having a similar issue recently. And, because I'm

short