Saturday 18 February 2012

JPA, Hibernate mapping

Small annoyance that get many people trip over is that if you have JPA entity mapping using property fields and have some mappings such as many to one at setter level you will get exception that it cannot find the entity (mapped in many to one, one to many)

so one need to stick to property mapping (@column ) and relationship maping on property level or at setter level

Thursday 19 January 2012

XA transactions weblogic spring 3.1 and oracle

Hi

I was recently making applications that uses XA transactions to read from JMS queue and write to Oracle Database.

The connection to the database was via weblogic datasource. Connection to the queue was via JNDI lookups for connection factory and JMS queue. I will not go into how to do it as there are several examples.

In Weblogic 10.3.0 (10gR3) i found a bug, basically when creating a datadource if you press enter after the jndi name. it creates a blank jndi!! I have by mistake created a JNDI myDatasource and then 3 enter keystrokes. it created 4 jndi entries for that datasource, and when the webapp tried to create a XA connection it would fail to get XA connection!

Weblogic should have detected this and given proper message. removing blank entries solved the problem.