[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] static final String gives null as value

Hi,

I have two bundles, A and B, where B imports the packages from A. A exports a service DAO with a function which looks like this


//Bundle A service DAO:
public static final String STATUS = "X";

public List getResults(int max) throws Exception {
EntityManager em = emFactory.createEntityManager();
List result = new ArrayList();

Query q = em.createQuery("select x  from Result x  where x.status = :status");
q.setParameter("status", STATUS ); //This should bind 'X' as a parameter
q.setMaxResults(max);
result = q.getResultList();
return result;
}

Bundle B calls the functions by looking up the DAO service and calling dao.getResult(1).

When equinox starts for the first time, all goes well, and I see in the logs of JPA

...bind(status,'X')

but when I stop and restart bundle A (where B restarts automatically because it imports) I get this

...bind(status,null)

so the public static final String STATUS returns null as value, whihc seems odd :-)

can anyone explain to me what might cause this error?

Regards,
Leen