[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 manually? According to JavaDoc, it's 
"nontransactional". See the following log (H2):

11:19:01,531 DEBUG SQL:104 - insert into StrTestEntity_AUD (REVTYPE, str, id, 
REV) values (?, ?, ?, ?)
11:19:03,687  WARN SqlExceptionHelper:143 - SQL Error: 50200, SQLState: HYT00
Timeout trying to lock table "STRTESTENTITY_AUD"; SQL statement:
select strtestent0_.REV as col_0_0_ from StrTestEntity_AUD strtestent0_ cross 
join REVINFO defaultrev1_ where strtestent0_.id=? 
and strtestent0_.REV=defaultrev1_.REV order by strtestent0_.REV asc [50200-145]
at 
org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:52)
...

Method AuditProcess.doBeforeTransactionCompletion() is responsible for 
persisting all audit data. The description in HHH-7017 is 
very accurate and correct. Please advice.

How is temporary session related to current normal session and its lifecycle?

Regards,
Lukasz
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


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 
obtained from org.hibernate.Session#sessionWithOptions

If the 2 should share JDBC connection, then 
org.hibernate.SharedSessionBuilder#connection() should be used.  If you 
want it to share the entire "transaction context", then 
org.hibernate.SharedSessionBuilder#transactionContext() should be used. 
  Pretty sure I asked Adam and the rest of the list about this 
transactionContext() method back when I first added it.  I never heard 
any response.  So if you go that transactionContext() route you may run 
into issues because I am pretty sure transactionContext() is sharing too 
much.


On 02/12/2012 04:40 AM, Łukasz Antoniak wrote:
> 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 manually? According to JavaDoc, it's 
> "nontransactional". See the following log (H2):
>
> 11:19:01,531 DEBUG SQL:104 - insert into StrTestEntity_AUD (REVTYPE, str, id, 
> REV) values (?, ?, ?, ?)
> 11:19:03,687  WARN SqlExceptionHelper:143 - SQL Error: 50200, SQLState: HYT00
> Timeout trying to lock table "STRTESTENTITY_AUD"; SQL statement:
> select strtestent0_.REV as col_0_0_ from StrTestEntity_AUD strtestent0_ cross 
> join REVINFO defaultrev1_ where strtestent0_.id=?
> and strtestent0_.REV=defaultrev1_.REV order by strtestent0_.REV asc 
> [50200-145]
>   at 
> org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:52)
> ...
>
> Method AuditProcess.doBeforeTransactionCompletion() is responsible for 
> persisting all audit data. The description in HHH-7017 is
> very accurate and correct. Please advice.
>
> How is temporary session related to current normal session and its lifecycle?
>
> Regards,
> Lukasz
> ___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

-- 
st...@hibernate.org
http://hibernate.org
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev

[hibernate-dev] metamodel tests

2012-02-12 Thread Steve Ebersole
There are a bunch of test failures in the new metamodel tests.  I know 
this stuff is changing all the time, but we really need to work on 
making sure that work we are doing is not causing regressions. 
Otherwise, this work will quickly become a situation of "1 step forward, 
2 steps back" instead of the other way around.

AFAICT, the errors all seem related to:
1) AttributeOverrides/orm.xml-overrides not being applied
2) funky column/table name resolution
3) general code changes based on things we discussed, without updating tests


-- 
st...@hibernate.org
http://hibernate.org
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


[hibernate-dev] Bug: DerbyTenSevenDialect doesn't override toBooleanValueString

2012-02-12 Thread Adam Bryzak
Derby 10.7 and later support a boolean data type, DerbyTenSevenDialect 
registers the type but doesn't override the toBooleanValueString method to 
return the literal values "true" and "false"

-- 
Adam Bryzak
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev