That is what I did ;-) But not an elegant solution.
-----邮件原件----- 发件人: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 代表 Matt Raible 发送时间: 2007年5月23日 11:47 收件人: [email protected] 主题: [appfuse-user] Re: 答复: [appfuse-user] an test error when execute "mvn package -Poracle" You could try changing the default data (in sample-data.xml) to use negative keys - i.e. -1 and -2 instead of 1 and 2. Matt On 5/22/07, chino fish <[EMAIL PROTECTED]> wrote: > What we can do ? waiting for oracle to do something ? > > Maybe we can try uuid to be the primary key ! > > -----邮件原件----- > 发件人: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 代表 Matt Raible > 发送时间: 2007年5月23日 1:24 > 收件人: [email protected] > 主题: Re: [appfuse-user] an test error when execute "mvn package -Poracle" > > This is a known issue with Oracle. > > http://issues.appfuse.org/browse/APF-718 > > Matt > > On 5/22/07, chinofish <[EMAIL PROTECTED]> wrote: > > I want to do some test staff in oracle, > > so i use the command: > > > > mvn package -Poracle > > > > but i got a test error, the error log is as follows: > > > > [shuibao_demo] ERROR [main] JDBCExceptionReporter.logExceptions(78) | > ORA-00001: 违反唯一约束条件 (SHUIBAO_DEMO.SYS_C0013393) > > > > [shuibao_demo] ERROR [main] > AbstractFlushingEventListener.performExecutions(301) | Could not synchronize > database state with session > > org.hibernate.exception.ConstraintViolationException: Could not execute > JDBC batch update > > at > org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) > > at > org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java > :43) > > at > org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249) > > at > org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235) > > at > org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139) > > at > org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(Abst > ractFlushingEventListener.java:298) > > at > org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventL > istener.java:27) > > at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) > > at > org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) > > at > org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) > > at org.springframework.orm.hibernate3.HibernateTransactionManager. > doCommit(HibernateTransactionManager.java:570) > > at > org.springframework.transaction.support.AbstractPlatformTransactionManager.p > rocessCommit(AbstractPlatformTransactionManager.java:651) > > at > org.springframework.transaction.support.AbstractPlatformTransactionManager.c > ommit(AbstractPlatformTransactionManager.java:621) > > at > org.springframework.transaction.interceptor.TransactionAspectSupport.commitT > ransactionAfterReturning(TransactionAspectSupport.java:311) > > at > org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Tr > ansactionInterceptor.java:117) > > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflect > iveMethodInvocation.java:161) > > at > org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopPro > xy.java:202) > > at $Proxy25.save(Unknown Source) > > at > org.appfuse.tutorial.webapp.action.PersonActionTest.onSetUpBeforeTransaction > (PersonActionTest.java:41) > > at > org.springframework.test.AbstractTransactionalSpringContextTests.onSetUp(Abs > tractTransactionalSpringContextTests.java:168) > > at > org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSing > leSpringContextTests.java:89) > > at junit.framework.TestCase.runBare(TestCase.java:128) > > > > It's clear that the error happened when execute > > line > > personManager.save(person) > > of method > > onSetUpBeforeTransaction > > > > I found the real reason leading to the error was that: > > > > the test case tried to insert a record with id=1 into the table Person > > but there was already a record with id=1. > > > > It seems that oracle can not process > > " @Id @GeneratedValue(strategy = GenerationType.AUTO)" > > correctly ?? > > > > oracle user sequence to deal with the situation, but unfortunately the > start value of the sequence is 1. > > > > //it's a bit of ridiculous.. > > > > any suggestion will be great appreciated !! > > > > > > > > > > chinofish > > 2007-05-23 > > > > > -- > http://raibledesigns.com > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- http://raibledesigns.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
