-->
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.  [ 11 posts ] 
Author Message
 Post subject: HELP! Database Operation in more than one thread
PostPosted: Tue Jan 13, 2004 2:12 am 
Newbie

Joined: Tue Jan 13, 2004 1:37 am
Posts: 11
AppServer:jboss3.1
Database: oracle 8.1.7
HIbernate:2.1

** Transaction modle use Hibernate JTA.
See Hibernate Config file:
<!-- properties -->
<property name="connection.datasource">java:OracleDS</property>
<property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>
<!--property name="dialect">net.sf.hibernate.dialect.SybaseDialect</property-->
<property name="show_sql">false</property>
<property name="connection.isolation">3</property>
<property name="use_outer_join">true</property>
<property name="jdbc.batch_size">10</property>
<property name="jdbc.fetch_size">100</property>
<property name="hibernate.jdbc.use_streams_for_binary">true</property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>

** EJB will take transaction control, such as commit database.

** There are two thread call the function named addData():
in addData(): there are two operation, the one is delete from database--call a(), the other is insert into database again--call b().
When running under two thread, problem occoured, one thread insert faild. Checking log file, database report --disobey uini-key constrain.
It seems that transaction not work,the order should be
a()-a()-b()-b(), but now it a()-b()-a()-b(). it works alternate.

Try: change addData() by using JDBC , it is no problem.
Try: change hibernate.connection.isolation level, no any help

who can help me deal with this problem, good will bless you!


Top
 Profile  
 
 Post subject: See real code here -(1)
PostPosted: Tue Jan 13, 2004 2:16 am 
Newbie

Joined: Tue Jan 13, 2004 1:37 am
Posts: 11
public Collection insertPosition(Collection positionInfoCollection, String userName) throws DbAccessException
{
logger.enterMethod();
Collection ret = new ArrayList();
NmsUserDAO nmsUserDAO = (NmsUserDAO) getDAODAOConst.NMSUSER_DAO);
long userId = -1;
Session sess = null;
try
{
sess = IdnSessionFactory.openSession();
if (positionInfoCollection.size() <= 0 || userName == null)
{
logger.debug("position size=" + positionInfoCollection.size() + " userName=" + userName);
throw new DbAccessException(DbAccessException.DBA_OTHER_EXCEPTION, ErrorReason.INSERT_OBJECT_FAILED_REASON);
}
else
{
userId = nmsUserDAO.selectUserIdByUserName(userName);
logger.debug("UserId=" + userId);
if (userId == -1)
{
throw new DbAccessException (DbAccessException.DBA_OTHER_EXCEPTION, ErrorReason.INSERT_OBJECT_FAILED_REASON);
}
else
{
String query = "from position in class com.idncn.mc.bo.Position where position.userId = ?";
long delNum = sess.delete(query, new Long(userId), Hibernate.LONG);
logger.debug("del num=" + delNum);
sess.flush();
for (Iterator iter = positionInfoCollection.iterator(); iter.hasNext(); )
{
PositionInfo positionInfo = (PositionInfo) (iter.next());
Position positionBo = new Position();
positionBo.setObjectId(positionInfo.getObjectId());
positionBo.setObjectType(positionInfo.getObjectType());
positionBo.setScreenX(positionInfo.getScreenX());
positionBo.setScreenY(positionInfo.getScreenY());
positionBo.setUserId(userId);
long newId = ((Long) sess.save(positionBo)).longValue();
ret.add(new Long(newId));
logger.debug("The position id is: " + newId);
}
sess.flush();
}
}
sess.close();
}
catch (DbAccessException e)
{
throw e;
}
catch (Exception e)
{
logger.error(e);
throw new DbAccessException(DbAccessException.DBA_OTHER_EXCEPTION);
}
finally
{
logger.exitMethod();
}
return ret;
}


Top
 Profile  
 
 Post subject: Test CASE
PostPosted: Tue Jan 13, 2004 2:17 am 
Newbie

Joined: Tue Jan 13, 2004 1:37 am
Posts: 11
public class TestThread implements Runnable{
private int j;
public TestThread(int i) {
this.j=i;
}
public void run(){
Collection list=new ArrayList();
for (int i = 0; i < 50; i++) {
PositionInfo po = new PositionInfo();
po.setObjectId(219+i);
po.setObjectType(i+100);
po.setScreenX(168+this.j);
po.setScreenY(666+this.j);
list.add(po);
}
try{
GsDataAccessEJBHome home = getHome();
GsDataAccessEJB remote = home.create();
remote.addPosition(list,"system");
}catch(Exception e){
System.out.println("exception found="+e);
}

}
public static void main(String args[]){
//thread one
TestThread test=new TestThread(1);
Thread thread=new Thread(test);
thread.start();
//thread two
TestThread test1=new TestThread(100);
Thread thread1=new Thread(test1);
thread1.start();
TestThread test2=new TestThread(2);
Thread thread2=new Thread(test2);
thread2.start();
//thread two
TestThread test3=new TestThread(200);
Thread thread3=new Thread(test3);
thread3.start();

try{
thread.join();
thread1.join();
thread2.join();
thread3.join();
}catch(Exception e){
System.out.print("d="+e);
}
}
private GsDataAccessEJBHome getHome(){
GsDataAccessEJBHome home=null;
try {
Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, "jnp://192.168.1.112:1099");
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");

Context ctx=new InitialContext(env);

//look up jndi name
Object ref = ctx.lookup(GsDataAccessEJBHome.JNDI_NAME);
//look up jndi name and cast to Home interface
home = (GsDataAccessEJBHome) PortableRemoteObject.narrow(ref, GsDataAccessEJBHome.class);
}catch (Exception e) {
System.out.println("**="+e);
}
return home;
}

}


Top
 Profile  
 
 Post subject: Error code Log
PostPosted: Tue Jan 13, 2004 2:17 am 
Newbie

Joined: Tue Jan 13, 2004 1:37 am
Posts: 11
DBLog|16:39:09,703|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117|net.sf.hibernate.JDBCException: Could not execute JDBC batch update
DBLog|16:39:09,703|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:125)
DBLog|16:39:09,828|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117|net.sf.hibernate.JDBCException: Could not execute JDBC batch update
DBLog|16:39:09,843|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2365)
DBLog|16:39:09,984|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2316)
DBLog|16:39:09,984|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2258)
DBLog|16:39:09,984|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at com.idncn.mc.dbaccess.util.IdnSession.flush(IdnSessionFactory.java:172)
DBLog|16:39:10,015|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at com.idncn.mc.dbaccess.dbapi.PositionApi.insertPosition(PositionApi.java:105)
DBLog|16:39:10,015|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at com.idncn.mc.dbaccess.ejb.DataAccessEJBBean.addPosition(DataAccessEJBBean.java:3072)
DBLog|16:39:10,015|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:125)
DBLog|16:39:10,015|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
DBLog|16:39:10,015|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117|net.sf.hibernate.JDBCException: Could not execute JDBC batch update
DBLog|16:39:10,015|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2365)
DBLog|16:39:10,031|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
DBLog|16:39:10,031|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:125)
DBLog|16:39:10,031|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2316)
DBLog|16:39:10,031|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2365)
DBLog|16:39:10,046|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2258)
DBLog|16:39:10,046|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2316)
DBLog|16:39:10,046|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at com.idncn.mc.dbaccess.util.IdnSession.flush(IdnSessionFactory.java:172)
DBLog|16:39:10,046|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2258)
DBLog|16:39:10,062|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at com.idncn.mc.dbaccess.dbapi.PositionApi.insertPosition(PositionApi.java:105)
DBLog|16:39:10,062|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
DBLog|16:39:10,062|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at com.idncn.mc.dbaccess.ejb.DataAccessEJBBean.addPosition(DataAccessEJBBean.java:3072)
DBLog|16:39:10,078|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.reflect.Method.invoke(Method.java:324)
DBLog|16:39:10,078|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at com.idncn.mc.dbaccess.util.IdnSession.flush(IdnSessionFactory.java:172)
DBLog|16:39:10,078|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
DBLog|16:39:10,093|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at com.idncn.mc.dbaccess.dbapi.PositionApi.insertPosition(PositionApi.java:105)
DBLog|16:39:10,093|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
DBLog|16:39:10,093|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at com.idncn.mc.dbaccess.ejb.DataAccessEJBBean.addPosition(DataAccessEJBBean.java:3072)
DBLog|16:39:10,109|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
DBLog|16:39:10,109|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
DBLog|16:39:10,109|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
DBLog|16:39:10,125|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
DBLog|16:39:10,125|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
DBLog|16:39:10,125|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
DBLog|16:39:10,140|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
DBLog|16:39:10,140|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
DBLog|16:39:10,140|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
DBLog|16:39:10,140|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.reflect.Method.invoke(Method.java:324)
DBLog|16:39:10,156|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
DBLog|16:39:10,156|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.reflect.Method.invoke(Method.java:324)
DBLog|16:39:10,156|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
DBLog|16:39:10,171|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
DBLog|16:39:10,171|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
DBLog|16:39:10,171|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
DBLog|16:39:10,187|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
DBLog|16:39:10,187|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
DBLog|16:39:10,203|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
DBLog|16:39:10,203|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
DBLog|16:39:10,203|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
DBLog|16:39:10,203|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
DBLog|16:39:10,218|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
DBLog|16:39:10,218|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
DBLog|16:39:10,234|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.Container.invoke(Container.java:674)
DBLog|16:39:10,234|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
DBLog|16:39:10,250|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
DBLog|16:39:10,250|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
DBLog|16:39:10,250|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
DBLog|16:39:10,250|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
DBLog|16:39:10,250|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
DBLog|16:39:10,265|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
DBLog|16:39:10,265|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
DBLog|16:39:10,281|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
DBLog|16:39:10,281|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
DBLog|16:39:10,281|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
DBLog|16:39:10,281|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
DBLog|16:39:10,296|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
DBLog|16:39:10,296|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.Container.invoke(Container.java:674)
DBLog|16:39:10,296|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
DBLog|16:39:10,312|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
DBLog|16:39:10,312|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
DBLog|16:39:10,328|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.reflect.Method.invoke(Method.java:324)
DBLog|16:39:10,328|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
DBLog|16:39:10,328|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
DBLog|16:39:10,328|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.reflect.Method.invoke(Method.java:324)
DBLog|16:39:10,343|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
DBLog|16:39:10,343|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
DBLog|16:39:10,343|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
DBLog|16:39:10,359|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.ejb.Container.invoke(Container.java:674)
DBLog|16:39:10,359|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
DBLog|16:39:10,359|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
DBLog|16:39:10,375|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
DBLog|16:39:10,375|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
DBLog|16:39:10,375|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
DBLog|16:39:10,375|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
DBLog|16:39:10,375|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
DBLog|16:39:10,390|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
DBLog|16:39:10,390|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
DBLog|16:39:10,390|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
DBLog|16:39:10,406|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.reflect.Method.invoke(Method.java:324)
DBLog|16:39:10,406|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
DBLog|16:39:10,406|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
DBLog|16:39:10,421|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
DBLog|16:39:10,421|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
DBLog|16:39:10,421|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.reflect.Method.invoke(Method.java:324)
DBLog|16:39:10,437|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.reflect.Method.invoke(Method.java:324)
DBLog|16:39:10,437|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
DBLog|16:39:10,437|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
DBLog|16:39:10,453|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.Transport$1.run(Transport.java:148)
DBLog|16:39:10,453|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
DBLog|16:39:10,453|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at java.security.AccessController.doPrivileged(Native Method)
DBLog|16:39:10,468|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
DBLog|16:39:10,468|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
DBLog|16:39:10,484|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
DBLog|16:39:10,484|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
DBLog|16:39:10,484|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
DBLog|16:39:10,484|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.Transport$1.run(Transport.java:148)
DBLog|16:39:10,484|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.reflect.Method.invoke(Method.java:324)
DBLog|16:39:10,484|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
DBLog|16:39:10,500|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at java.security.AccessController.doPrivileged(Native Method)
DBLog|16:39:10,500|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
DBLog|16:39:10,500|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
DBLog|16:39:10,515|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.Transport$1.run(Transport.java:148)
DBLog|16:39:10,515|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
DBLog|16:39:10,515|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at java.security.AccessController.doPrivileged(Native Method)
DBLog|16:39:10,515|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.Thread.run(Thread.java:534)
DBLog|16:39:10,531|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
DBLog|16:39:10,531|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117|Caused by: java.sql.BatchUpdateException: ORA-00001: 违反唯一约束条件 (QHE.AK_OBJECT_UK_POSITION)

DBLog|16:39:10,531|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
DBLog|16:39:10,546|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:441)
DBLog|16:39:10,546|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
DBLog|16:39:10,562|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3377)
DBLog|16:39:10,562|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.Thread.run(Thread.java:534)
DBLog|16:39:10,562|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:701)
DBLog|16:39:10,562|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117|Caused by: java.sql.BatchUpdateException: ORA-00001: 违反唯一约束条件 (QHE.AK_OBJECT_UK_POSITION)

DBLog|16:39:10,578|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:52)
DBLog|16:39:10,578|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:441)
DBLog|16:39:10,593|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
DBLog|16:39:10,593|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:118)
DBLog|16:39:10,593|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at java.lang.Thread.run(Thread.java:534)
DBLog|16:39:10,593|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3377)
DBLog|16:39:10,609|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117|Caused by: java.sql.BatchUpdateException: ORA-00001: 违反唯一约束条件 (QHE.AK_OBJECT_UK_POSITION)

DBLog|16:39:10,609|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:701)
DBLog|16:39:10,625|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:441)
DBLog|16:39:10,625|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:52)
DBLog|16:39:10,625|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3377)
DBLog|16:39:10,640|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:118)
DBLog|16:39:10,640|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:701)
DBLog|16:39:10,640|RMI TCP Connection(4)-192.168.1.112|ERROR|PositionApi.java|117| ... 39 more
DBLog|16:39:10,656|RMI TCP Connection(4)-192.168.1.112|INFO|PositionApi.java|124|LEAVE com.idncn.mc.dbaccess.dbapi.PositionApi.insertPosition
DBLog|16:39:10,750|RMI TCP Connection(1)-192.168.1.112|ERROR|PositionApi.java|117| ... 39 more
DBLog|16:39:10,750|RMI TCP Connection(1)-192.168.1.112|INFO|PositionApi.java|124|LEAVE com.idncn.mc.dbaccess.dbapi.PositionApi.insertPosition
DBLog|16:39:10,890|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:52)
DBLog|16:39:10,890|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:118)
DBLog|16:39:10,890|RMI TCP Connection(3)-192.168.1.112|ERROR|PositionApi.java|117| ... 39 more
DBLog|16:39:10,906|RMI TCP Connection(3)-192.168.1.112|INFO|PositionApi.java|124|LEAVE com.idncn.mc.dbaccess.dbapi.PositionApi.insertPosition


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 5:14 am 
Newbie

Joined: Tue Jan 13, 2004 1:37 am
Posts: 11
up


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 5:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
bennyfong wrote:
up


Please stop that, someone will answer as soon as he finds time to work through the 5 pages you posted, no need to get on our nerves!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 7:19 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
try to use batch_size=0

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 8:43 pm 
Newbie

Joined: Tue Jan 13, 2004 1:37 am
Posts: 11
emmanuel:
thanks,I have tried but problem still.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 14, 2004 5:29 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Exact same exception ?
What does that mean 违反唯一约束条件 (QHE.AK_OBJECT_UK_POSITION) ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject: thanks
PostPosted: Wed Jan 14, 2004 10:16 pm 
Newbie

Joined: Tue Jan 13, 2004 1:37 am
Posts: 11
Yes, that's mean disorder unique key constraint on the table.


Top
 Profile  
 
 Post subject: Find a temporary way
PostPosted: Fri Jan 30, 2004 4:04 am 
Newbie

Joined: Tue Jan 13, 2004 1:37 am
Posts: 11
use "Session.lock", lock related table when update. This problem seems OK.
But I think it is NOT the real solution. Because the system is running under
muti-client env, how I can deal with request from muti-clent user?

It seams that hibernate save the db operation request temploray, and commit it at one time.

I beg the answer.

Those ways I have tried:
1) Change batch size to 0
2) use hibernate transaction.
3) use Jboss Ejb transaction.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 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.