[ 
https://issues.apache.org/jira/browse/TAPESTRY-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576937#action_12576937
 ] 

Massimo Lusetti commented on TAPESTRY-2247:
-------------------------------------------

Well you certainly would to not submit (aka call session.save()) on entities 
till you're sure all validation and business check are in place so calling it 
before seems a very bad practice and should avoided.
For the second use case, as you said if the entity is persisted into the 
session you have to reattach it to the hibernate session during subsequent 
utilization, so this would force me to call also a commit too (if needed to be 
committed). BTW persiting entities in the session is also another bad practice.

I understand this as a way to encourage bad practices, they are probably widely 
used but still bad. Your propose of a configuration symbol is nice and i would 
probably make it even defaults to the current behaviour.

> Don't commit the transaction automatically at the end of the request
> --------------------------------------------------------------------
>
>                 Key: TAPESTRY-2247
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2247
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-hibernate
>    Affects Versions: 5.0.10
>            Reporter: Dan Adams
>            Assignee: Dan Adams
>
> On thread cleanup, the Session should be flushed not committed. If people 
> want to commit changes they should explicitly do so but having the 
> transaction committed automatically can lead to some very mysterious changing 
> of the data. In my experience, having the transaction committed automatically 
> does more harm than good.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to