My Entity class looks as follows :
@Entity
class Entity {
private UUID id;
private String name;
// normal getters and setters
@PrePersist
public void init(){
if(id == null){
setId(UUID.randomUUID());
}
}
In my persistence.xml, I have following :-
<property name="hibernate.jdbc.batch_size" value="30"/>
<property name="hibernate.order_inserts" value="true"/>
<property name="hibernate.order_updates" value="true"/>
Within a single transaction, I am calling "entityManager.persist(myEntity)" inside a for loop. The exact number of iterations may vary across multiple runs.
In my logging configuration I have following,
<logger category="org.hibernate.jdbc.BatchingBatcher">
<level name="DEBUG"/>
</logger>
<logger category="org.hibernate.jdbc.AbstractBatcher">
<level name="DEBUG"/>
</logger>
<logger category="org.hibernate.persister.entity.AbstractEntityPersister">
<level name="DEBUG"/>
</logger>
However, in the server's log, I can not find any evidence of any sort of batching being performed during insert. I am using Hibernate as a JPA provider.
Any idea what am I doing wrong here ?