[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: How to configure batch/fetch size
qbacomarch
do-not-reply at jboss.com
Mon Jul 24 04:18:56 EDT 2006
Well, I tried this, but it didn't work.
Here's my persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
| <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
| <persistence-unit name="DBTestOne-ejb" transaction-type="JTA">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>OracleDS</jta-data-source>
| <class>DBTest.EJBTestEntity</class>
| <properties>
| <property name="hibernate.jdbc.batch_size" value="25"/>
| </properties>
| </persistence-unit>
| </persistence>
|
The database logs show, that there are 73 rows in 8 fetches.
Here's the code of the session bean thath queries the database:
@Stateless
| public class EJBTestSessionBean implements DBTest.EJBTestSessionRemote {
|
| @PersistenceContext
| EntityManager em;
|
| public EJBTestSessionBean() {}
|
| public Collection<EJBTestEntity> getEJBTestEntity(){
| Query query;
| query = em.createQuery("from EJBTestEntity t"); /
| return query.getResultList();
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960255#3960255
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960255
More information about the jboss-user
mailing list