Ticket #1185 - behaviour change for TG1.1?

View: New views
9 Messages — Rating Filter:   Alert me  

Ticket #1185 - behaviour change for TG1.1?

by Paul Johnston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

This ticket is about whether SQLAlchemy should do a rollback, if you
raise an exception in your controller method, and handle it with the
exception_handler decorator.

Current behaviour is that it does NOT rollback in that instance. Should
we change this in TG1.1? My gut feel is that the desirable behaviour is
to rollback anything done in the failing controller method, and start a
new transaction for anything in the handler method.

However, this is a behviour change. If I hear nothing from the list,
I'll assume this isn't a great issue and leave things be.

Paul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@...
To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Ticket #1185 - behaviour change for TG1.1?

by Jorge Godoy-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Wednesday 22 August 2007 14:45:29 Paul Johnston wrote:

> Hi,
>
> This ticket is about whether SQLAlchemy should do a rollback, if you
> raise an exception in your controller method, and handle it with the
> exception_handler decorator.
>
> Current behaviour is that it does NOT rollback in that instance. Should
> we change this in TG1.1? My gut feel is that the desirable behaviour is
> to rollback anything done in the failing controller method, and start a
> new transaction for anything in the handler method.
>
> However, this is a behviour change. If I hear nothing from the list,
> I'll assume this isn't a great issue and leave things be.

My opinion has always been: do the same as SQL Object does.

Both interfaces should do the same thing and be as interchangeable as
possible.

--
Jorge Godoy      <jgodoy@...>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@...
To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Ticket #1185 - behaviour change for TG1.1?

by Paul Johnston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

>My opinion has always been: do the same as SQL Object does.
>  
>
Fair point. SQLObject currently has the same behaviour as SQLAlchemy. If
we change SA we should change SO as well.

Which leads us back to... do we want to make the change?

Paul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@...
To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Ticket #1185 - behaviour change for TG1.1?

by Alberto Valverde :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Aug 24, 2007, at 11:17 AM, Paul Johnston wrote:

>
> Hi,
>
>> My opinion has always been: do the same as SQL Object does.
>>
>>
> Fair point. SQLObject currently has the same behaviour as  
> SQLAlchemy. If
> we change SA we should change SO as well.
>
> Which leads us back to... do we want to make the change?

+1 from me. I have no notes to back it up and my memory is not  
helping me here very much but I believe having some issues (maybe  
memory leaks?) when transactions were not rolled back if an exception  
ocurred. This was in the transaction handling middleware I posted in  
this list a couple of months ago (not on a TG app).

Alberto

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@...
To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Ticket #1185 - behaviour change for TG1.1?

by Paul Johnston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

>+1 from me. I have no notes to back it up and my memory is not  
>helping me here very much but I believe having some issues (maybe  
>memory leaks?) when transactions were not rolled back if an exception  
>ocurred. This was in the transaction handling middleware I posted in  
>this list a couple of months ago (not on a TG app).
>  
>
I looked into this some more, and someone had already had a go, I guess
some time previously. I hadn't noticed it before as it's in
errorhandling.py. So this isn't a behaviour change after all. I fixed up
the previous attempt a little, so you can now use the database in an
exception handler, and I've added a unit test. I've closed ticket #1185.

This is different behaviour to SQLObject, but I suggest leaving the SO
code as it is, for compatibility.

Paul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@...
To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Ticket #1185 - behaviour change for TG1.1?

by Jorge Godoy-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Friday 31 August 2007 17:25:21 Paul Johnston wrote:
> This is different behaviour to SQLObject, but I suggest leaving the SO
> code as it is, for compatibility.

This is not a good idea in my opinion.  It will lead people migrating from SO
to SA to take a wrong assumption on what will happen with their code and this
might lead to bugs.

--
Jorge Godoy      <jgodoy@...>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@...
To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Ticket #1185 - behaviour change for TG1.1?

by Paul Johnston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

>This is not a good idea in my opinion.  It will lead people migrating from SO
>to SA to take a wrong assumption on what will happen with their code and this
>might lead to bugs.
>  
>
I'm easy on this. It should be quite easy to implement this for SO, in
fact doing so would be an impetus to move the database code out of
errorhandling.py. What do people reckon - do in 1.0? leave to 1.1? don't
do at all?

Paul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@...
To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Ticket #1185 - behaviour change for TG1.1?

by Jorge Godoy-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Saturday 01 September 2007 13:36:35 Paul Johnston wrote:
> I'm easy on this. It should be quite easy to implement this for SO, in
> fact doing so would be an impetus to move the database code out of
> errorhandling.py. What do people reckon - do in 1.0? leave to 1.1? don't
> do at all?

I'm tempted to say "1.0", just because of the removal of the database code,
making things more modular.

What do other people think?

--
Jorge Godoy      <jgodoy@...>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@...
To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Ticket #1185 - behaviour change for TG1.1?

by Paul Johnston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

>I'm tempted to say "1.0", just because of the removal of the database code,
>making things more modular.
>  
>
Ok, I've moved that code, creating a generic function
restart_transaction, just like run_with_transaction. I've left the SO
bit blank for now, so there's no behaviour change, but that's easy to
change.

Paul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@...
To unsubscribe from this group, send email to turbogears-trunk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---