openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From garpinc <garp...@yahoo.com>
Subject Can someone explain this OpenJPA trace?
Date Sat, 11 Aug 2012 15:12:44 GMT
I'm executing the following code:
        CriteriaBuilder cb = em.getCriteriaBuilder();
        CriteriaQuery<?> q = cb.createQuery();
        Root<?> c = q.from(AnzoURIToPK.class);
        ParameterExpression<String> uriParam = cb.parameter(String.class);
        ParameterExpression<String> typeUriParam =
cb.parameter(String.class);
        q.multiselect(c).where(cb.and(cb.equal(c.get("uriHash"), uriParam),
cb.equal(c.get("typeUriHash"), typeUriParam)));
        TypedQuery<?> query = em.createQuery(q);
        query.setParameter(uriParam, uriHash);
        query.setParameter(typeUriParam, typeUriHash);
        Object result = query.getSingleResult();

I'm assigning this object to be the pk of another object and at commit time
I'm getting following trace. I can't understand where the second query is
coming from with a lookup with pk 0. Anyone have any ideas?


<t 807465830, conn 689339766> executing prepstmnt 571361198 SELECT t0.pk,
t0.datasetUri, t0.datasetUriHash, t0.persitedFully, t0.typeUri,
t0.typeUriHash, t0.uri, t0.uriHash FROM anzouritopk t0 WHERE (t0.uriHash = ?
AND t0.typeUriHash = ?) [params=(String)
a970c5c56f105448f56709071f5cbc647ddbfdad, (String)
4b77c3c0518556463d2a45298a73afbff3d69d16]
<t 807465830, conn 689339766> [0 ms] spent
<t 807465830, conn 0> [1 ms] close
Cache miss while looking up key "0".
<t 807465830, conn 689339766> executing prepstmnt 1800965748 SELECT
t0.datasetUri, t0.datasetUriHash, t0.persitedFully, t0.typeUri,
t0.typeUriHash, t0.uri, t0.uriHash FROM anzouritopk t0 WHERE t0.pk = ?
[params=(long) 0]
<t 807465830, conn 689339766> [0 ms] spent
<t 807465830, conn 0> [0 ms] close
 Executing query: [Query: org.apache.openjpa.kernel.QueryImpl@6c4c4e99;
candidate class: class
com.cambridgesemantics.anzo.relationalreplicator.jpa.model.AnzoURIToPKImpl;
query: null] with parameters: ?



--
View this message in context: http://openjpa.208410.n2.nabble.com/Can-someone-explain-this-OpenJPA-trace-tp7580862.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message