Re: [hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-20 Thread Łukasz Antoniak
Steve, I have created a JIRA issue (https://hibernate.onjira.com/browse/HHH-7090) and assigned it to you. Why do you think that we should not fix this in the upcoming release? I have also noticed that auto-closing feature of SharedSessionBuilder does not work as documented in JavaDoc. Please s

Re: [hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-20 Thread Steve Ebersole
Well these are the kind of details I was asking about with transactionContext() :) So transactionContext() is sharing too much of itself at the moment to use it this way. Currently it just shares the entire org.hibernate.engine.transaction.spi.TransactionContext from the originating Session.

Re: [hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-17 Thread Łukasz Antoniak
I totally agree with you guys :). However, when I do something like: if (FlushMode.isManualFlushMode(session.getFlushMode())) { Session temporarySession = null; try { temporarySession = ((Session) session).sessionWithOptions().transactionContext()

Re: [hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-14 Thread Adam Warski
Yes, I also think the session should be closed after being used, otherwise you start wondering why it's not being closed (as I did looking at the code) :) Adam On Feb 13, 2012, at 9:59 PM, Steve Ebersole wrote: > In general, yes, this is what I meant. > > I think on_close or after_transaction

Re: [hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-14 Thread Adam Warski
> Probably openTemporarySession() should be deprecated. Notice it also > says it is for HEM use, though the only current uses I see of it all > come from envers. Right, I was never happy using it, but I don't think there were other options at that time. Or I just couldn't find them. > Prett

Re: [hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-13 Thread Steve Ebersole
In general, yes, this is what I meant. I think on_close or after_transaction might be better connection release mode here. Also, I would personally be more inclined to close the "temp session" manually there in that block. But that part is really just a preference I think. On Mon 13 Feb 201

Re: [hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-13 Thread Łukasz Antoniak
Thanks Steve for such a descriptive replay. I have played a little with SessionBuilder and probably solved the issue. Because of great importance of AuditProcess#doBeforeTransactionCompletion(SessionImplementor) method, please verify my commit: https://github.com/lukasz-antoniak/hibernate-core

Re: [hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-12 Thread Steve Ebersole
Probably openTemporarySession() should be deprecated. Notice it also says it is for HEM use, though the only current uses I see of it all come from envers. If you want to share information from the main session, then the appropriate access would be to use org.hibernate.SharedSessionBuilder as

[hibernate-dev] Temporary session and commit issue with manual flush mode

2012-02-12 Thread Łukasz Antoniak
Hi all, I have a question regarding SessionFactoryImplementor.openTemporarySession() (bug HHH-7017). As observed in non JTA environment with manual flush mode enabled, and 'hibernate.connection.autocommit' disabled, temporary session is not getting committed. How/when should I commit it manual