Hi,

i am facing some weird performance issues. Given this  JPA Query:

public class SomeDao {
    @SuppressWarnings("unchecked")
    public Object getMetaData(Foo.class, long oid) {
        Object o = em.find(clazz, client);
        return o;
    }
..
}


@Entity
@VersionColumn(name = "jpaversion")
@Table(name = "foo")
public class Foo extends BasicClientMetaData {

    @Id
    @Column(name = "client_oid")
    private long client;
...
}

@MappedSuperclass
public class BasicClientMetaData implements MinMaxWeightAware {


    @Column(name = "custnr")
    private String customerNumber;

    @Column(name = "maxweight")
    private float maxWeightStandard;
..
}

When i call the getMetaData() of SomeDao.class (which is transactional and gets 
detached when its returned to the caller), i measured 500ms for this operation. 
The underlying SQL only consumes 20ms which i checked by setting the SQL log 
level to TRACE.

Why is there such a difference? I mean, detaching cant be such an issue from 
performance perspective. I only have this issue with exactly these kind of 
classes (children of BasicClientMetaData).

But i also have other classes which have the @MappedSuperclass which work 
without performance problems. Does anyone have a hint where i can look out for?


thanks.

---
regards
Marc Logemann
http://www.logemann.org
http://www.logentis.de




Reply via email to