-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: EJB3 and batch_size
PostPosted: Thu Dec 15, 2005 8:07 am 
Newbie

Joined: Sun Nov 13, 2005 7:36 am
Posts: 6
How to specify batch_size, when using ejb3 with JBoss?
I thought it should be put in persistence.xml , but in my case it seems, that this parameter is being ignored.

When I use batching on the same database/table with direct JDBC I get inserts 2-3 times faster than with EJB3, and
setting hibernate.jdbc.batch_size=0 or 100, doesn't change performance at all.

Any suggestions?

Hibernate version:
JBoss 4.0.3SP1

Mapping documents:
persistence.xml
<entity-manager>
<jta-data-source>java:/MySqlDS</jta-data-source>
<properties>

<property name="hibernate.hbm2ddl.auto" value="none"/>

<property name="hibernate.jdbc.batch_size" value="10" />

<property name="hibernate.jdbc.batch_versioned_data" value="true"/>

<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

</properties>
</entity-manager>

Code between sessionFactory.openSession() and session.close():

@Stateless
public class AServiceBean implements AServiceInterface {
@PersistenceContext static private EntityManager em;

public void createProps(Prop[] props) {
for (int i = 0; i < props.length; i++) {
em.persist(props[i]);
}
}
}

Name and version of the database you are using:
MySQL 5.0.16-win32


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 15, 2005 6:34 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
If your posting (or a question you are referring to) was not answered by anybody, the possible reasons are:

- http://www.hibernate.org/ForumMailingli ... AskForHelp
- You did not submit enough information
- Nobody knows the answer or has the free time to answer

What you can do now:

- Do the things listed in After Posting
- Add missing and/or more information
- Consider commercial support for guaranteed expert response times

This is a high-traffic forum run by volunteers with hundreds of postings made every day. The community works because people try to help others in their free time. Nobody is paid for this service or has to pay.

You should not expect a timely response and you should not rely on a public community forum for critical cases.

All community members should respect the rules of this forum and treat others like they would prefer to be treated.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.