Hibernate DetachedCriteria is not reusable

Once you execute following code:

Criteria criteria = detachedCriteria

you cannot reause the detachedCriteria for creating another one executable criteria because they are connected together (e.g. setting projection or pagination for criteria modifies also detachedCriteria object).

You must do following workarounds:


detachedCriteria.setResultTransformer( Criteria.ROOT_ENTITY );
detachedCriteria.setProjection( null );

For more info see Hibernate forum –

Suspending transaction by Spring must not work on JBoss 4.0.x

If you don’t use only Spring APIs to manage transactions and connections you may exercise that transaction suspension does not work on JBoss 4.0.x.

For more information see:

Buy Motrin
Phentermine 37.5
Buy Celebrex
With low credit scores
Credit reporting in
Buy Propecia
Credit plus score
Lowest apr credit cards
Free Cingular Ringtones
Instant free credit report
Linux VPN
Tramadol Hydrochloride
On credit scores
Buy Female Viagra
Advair Diskus
On credit scores
Anonymous surfing
VPN tunneling
Explaining credit report scores
Check credit scores
Correcting credit reports
Card credit debt divorce
Buy Zetia
Buy Singulair
Beacon score credit report
Internet privacy
Online Viagra Jelly
Credit report mortgage leads
Cheap Viagra Jelly
Eminem Ringtones
Cheap Imitrex
Open VPN
Install VPN
Seting up a VPN
Buy Cipro
Copy of credit report
Buy Premarin
Sprint Ringtones
Your credit reports
Caller Ringtones
Online Tramadol
Butterfly Ringtones
Buy Singulair
Cheap Buspar
Cheap Acomplia
Online Ultram
Buy Avandia
Remove credit card debt
Improve credit scores
Cheap Viagra Soft Cialis Soft
Propecia Canada
Cheap Hoodia

List of books/papers that I’ve read in 2008

Oracle the same as Informix

I wrote about my problems with Informix. Now we are facing similar problem on Oracle. It results in deadlock. The SQLs are more complex, but core problem is still in full table scan on small data locking the whole table because of full table scan.
We have to find config setting to force Oracle to always use indexes. We know only hint, that increases chance of using indexes – ALTER SESSION SET OPTIMIZER_INDEX_COST_ADJ = 1.

Advice1: don’t use micro benchmark.

Advice2: Don’t slouch on deadlock, you should be able to live them. It’s compromise for gained performance.

Solution: If an index exists on the foreign key column of the child table, no DML locks, other than a lock over the rows being modified, are required.

If the index is not created, a share lock is taken out on the child table for the duration of the transaction.

The referential integrity validation could take several minutes or even hours to resolve. The share lock over the child table will allow other users to simultaneously read from the table, while restricting certain types of modification. The share lock over the table can actually block other normal, everyday modification of other rows in that table.

List of books/papers that I’ve read in 2007

Informix giving me lessons from database implementation

I wrote about my problems with Informix IDS several days ago.

That problem is sovled now:

“The number of rows in the table is small enough to cause the database server to perform a sequential scan, and an index scan on a table with lock mode configured to row.”

You can setup IDS to use indexes all time which gets you off my problem. See Informix suport page for further info.

The infromation about locking previous and next record in index was outdated. Informix does not make this since v7.

I will bethink pretty much locking problems with other databases.
We still have problems with deleting data from tables using SQL.

Solution: OPTCOMPIND parameter

OPTCOMPIND is an environment variable or a parameter in the Informix configuration file. The optimizer uses its value to determine its choice of the data access method. It has one of three values (0, 1 and 2), which indicate the following:

  • If the value is set to 0, then the optimizer chooses index scans over table scans if appropriate indexes exist, without even considering the estimated costs.
  • If the value is set to 1, then the optimizer behaves as it does for value 0 if the transaction isolation mode is not Repeatable Read. If the transaction isolation mode is Repeatable Read, then the optimizer would base its choice purely on the estimated costs.
  • If value is set to 2, the optimizer would uses estimated costs to determine an execution plan regardless of the transaction isolation mode.

You may either set OPTCOMPIND either as an environment variable or as a parameter in the configuration file, but setting it as a parameter will take precedence on execution.

Link: Tuning Informix SQL