Yes. I think it will be reasonable because in the real environment
each inserting may be arosed by different client and be in one
transaction.
2008/1/22, Pinaki Poddar <[EMAIL PROTECTED]>:
>
> Are you are beginning/committing 1000 transactions to insert 1000 instances?
>
>
> Chengdong Lu wrote:
> >
> >
> > My test is to insert 1000 records into the table. The test code is like
> > this:
> > private static void insertJPA() throws DAOException, SQLException {
> > DAOFactory daoF = new DAOFactory();
> > AccountDao accountDao = daoF.getAccountDao();
> > System.out.println(new java.util.Date().toString());
> >
> > for (int i = 0; i<1000; i++)
> > {
> >
> > TransactionProxy tran = accountDao.beginTransaction();
> > Account newuser = new Account();
> > newuser.setName("user" + i);
> > //newuser.setFullname("User No. " + i);
> > //newuser.setDescript("Common user");
> > accountDao.insert(newuser);
> > accountDao.commitTransaction(tran);
> > }
> > }
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Weird-Performance-Problem-tp14998594p15003474.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>