PESSIMISTIC_FORCE_INCREMENT lock mode
by Arnold Gálovics
Hi all,
I'm a bit confused with the mentioned lock mode.
*The doc says the following:*
*"The entity is locked pessimistically and its version is incremented
automatically even if the entity has not changed."*
I'm checking this with an H2 DB and the current behavior is the following:
- the version attribute is incremented in advance, right after fetching
(I'm using EntityManager#find here, but with lock, it should be the same)
- the original fetching query contains the SELECT ... FOR UPDATE clause
Knowing this, it seems for me that this lock mode involves a DB lock,
however the doc doesn't say anything about this, especially whether it's a
shared or exclusive lock.
I've checked Vlad's article about this.
https://vladmihalcea.com/2015/02/16/hibernate-locking-patterns-how-does-p...
It says the following: "*The PESSIMISTIC_FORCE_INCREMENT naming might lead
you into thinking that you are using a pessimistic locking strategy, while
in reality this Lock Mode is just an optimistic locking variation."*
So now I'm unsure what this really is.
Could you please briefly describe it to me if I missed something?
Thanks in advance!
Best Regards,
Arnold
8 years, 5 months
Difference between Comment and Hint in Hibernate query
by Vlad Mihalcea
Hi,
While working on integrating a Pull Request, I realized that the
org.hibernate.engine.spi.QueryParameters provides these two attributes:
private String comment;
private List<String> queryHints;
Both these two are to be sent to the database, so why do we have both?
I also noticed that only for Query Hints we do take into consideration DB
specific query hint syntax:
// Keep this here, rather than moving to Select. Some Dialects may
need the hint to be appended to the very
// end or beginning of the finalized SQL statement, so wait until
everything is processed.
if ( parameters.getQueryHints() != null &&
parameters.getQueryHints().size() > 0 ) {
sql = dialect.getQueryHintString( sql, parameters.getQueryHints() );
}
Shouldn't we only have either comment or queryHints? Or what is the
difference between these two?
Vlad
8 years, 5 months
CI Updates
by Davide D'Alto
Hello,
I'm going to update Jenkins next Monday, I'll do my best to keep the
downtime to a minimum but,
because there are several plugins to update, I expect some disruption.
I'll do my best to keep it at a minimum
The exact date is going to be the 6th of August.
Thanks,
Davide
8 years, 5 months