-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem in simple select - Error "was altered from 1 to
PostPosted: Fri Sep 08, 2006 12:59 pm 
Newbie

Joined: Mon Jan 03, 2005 10:57 pm
Posts: 14
Hi,

I'm try to do a simple query when i run the query the hibernate show me the error :

Was altered from 1 to 0
Caused by: org.hibernate.HibernateException: identifier of an instance of br.com.bvsistemas.servicoteste.integracao.impl.VUsuarioImpl was altered from 1 to 0

Some one know what happend and can help me ?

[]s


Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
   
<hibernate-mapping>
<!--
    Created by the Middlegen Hibernate plugin 2.2

    http://boss.bekk.no/boss/middlegen/
    http://www.hibernate.org/
-->

<class
    name="br.com.bvsistemas.servicoteste.integracao.impl.VUsuarioImpl"
    table="tbusuario"
    lazy="false"
    schema="dbteste"
>

    <id
        name="cdUsuario"
        type="java.lang.Integer"
        column="CdUsuario"
    >
   
        <generator class="increment" />
    </id>

    <property
        name="nmUsuario"
        type="java.lang.String"
        column="NmUsuario"
        length="100"
    />

    <!-- Associations -->
 

</class>
</hibernate-mapping>


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

Code:
Query query = session.createQuery("from VUsuarioImpl o");
return  query.list();


Full stack trace of any exception that occurs:
Code:
org.hibernate.HibernateException: identifier of an instance of br.com.bvsistemas.servicoteste.integracao.impl.VUsuarioImpl was altered from 1 to 0
   at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:58)
   at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:157)
   at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:113)
   at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
   at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:993)
   at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:340)
   at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
   at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
   at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
   at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
   ... 28 more

Name and version of the database you are using:
MySql 3

The generated SQL (show_sql=true):
Code:
16:49:50,921 INFO  [STDOUT] Hibernate: select vusuarioim0_.CdUsuario as CdUsuario64_, vusuarioim0_.NmUsuario as NmUsuario64_ from dbteste.tbusuario vusuarioim0_



[/code]


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

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.