openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DOMINGUEZ Felipe" <Felipe.DOMING...@eurocontrol.int>
Subject RE: insert 500k row
Date Thu, 07 Feb 2008 13:12:37 GMT
Hello.

I see you have commented out the flush() lines. Is it commented when you
use Hibernate too?

Cheers

Felipe 

-----Original Message-----
From: Janos Haber [mailto:boci.list@gmail.com] 
Sent: Thursday 07 February 2008 14:08
To: users@openjpa.apache.org
Subject: insert 500k row

Hi!

I try to insert 500.000 row to the table (for testing). When my code run
the java eat 100% cpu (if I use hibernate it's 1-10%, but I want to use
openjpa).

Anybody know why?
testDao.persist simply call EntityManager.persist.

Cow

ps:

My code:
	public final static long repeat = 50 * 10000; ...

	@org.junit.Test
	public void fieldNumber() {
		logger.info("Create new datas");
		for (int i = 0; i < repeat; i++) {
			Test t = new Test();
			t.setFieldA1("Field test a1 = " + i);
			t.setFieldA2("Field test a2 = " + i);
			t.setFieldA3("Field test a3 = " + i);
			t.setFieldA4("Field test a4 = " + i);
			t.setFieldA5("Field test a5 = " + i);
			t.setFieldA6("Field test a6 = " + i);
			t.setFieldA7("Field test a7 = " + i);
			t.setFieldA8("Field test a8 = " + i);
			t.setTestName(i + " name field");
			t.setTestBool((i % 2 > 0) ? true : false);
			t.setTestDate(new Date());
			t.setTestLong(i);
			t.setTestString("String field");
			testDao.persist(t);
			if (i % 1000 == 0) {
				logger.info("Row:"+i);
				//testDao.flush();
				//testDao.clear();
			}
		}
		long num = (Long) testDao
				.findSingleObject("select COUNT(test)
from Test test");
		Assert.assertEquals(
				"Too bad, the num is " + num + " and not
" + repeat, repeat,
				num);
	}
____

This message and any files transmitted with it are legally privileged and intended for the
sole use of the individual(s) or entity to whom they are addressed. If you are not the intended
recipient, please notify the sender by reply and delete the message and any attachments from
your system. Any unauthorised use or disclosure of the content of this message is strictly
prohibited and may be unlawful.

Nothing in this e-mail message amounts to a contractual or legal commitment on the part of
EUROCONTROL, unless it is confirmed by appropriately signed hard copy.

Any views expressed in this message are those of the sender.


Mime
View raw message