Hibernate DetachedCriteria is not reusable

Once you execute following code:

Criteria criteria = detachedCriteria
.getExecutableCriteria(session);

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:

criteria.setMaxResults(0);
criteria.setFirstResult(0);

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

For more info see Hibernate forum –
http://forum.hibernate.org/viewtopic.php?t=939308

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
Paxil
Phentermine 37.5
Zetia
Zoloft
Buy Celebrex
With low credit scores
Coreg
Credit reporting in
Buy Propecia
Amaryl
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
Propecia
Atarax
Zyrtec
On credit scores
Anonymous surfing
Ultram
VPN tunneling
Avodart
Explaining credit report scores
Lorazepam
Check credit scores
Ativan
Correcting credit reports
Card credit debt divorce
Buy Zetia
Buy Singulair
Beacon score credit report
Internet privacy
Cozaar
Online Viagra Jelly
Credit report mortgage leads
Cheap Viagra Jelly
Prozac
Eminem Ringtones
Cheap Imitrex
Open VPN
Install VPN
Seting up a VPN
Buy Cipro
Copy of credit report
Tylenol
Buy Premarin
Tamiflu
Sprint Ringtones
Your credit reports
Caller Ringtones
Online Tramadol
Norvasc
Butterfly Ringtones
Pravachol
Buy Singulair
Cheap Buspar
Flomax
Cheap Acomplia
Online Ultram
Didrex
Buy Avandia
Bontril
Remove credit card debt
Improve credit scores
Hydrocodone
Crestor
Zoloft
Prozac
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