-->
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: NonUniqueObjectException and session.clear()
PostPosted: Tue Nov 02, 2004 3:43 pm 
Regular
Regular

Joined: Sat May 29, 2004 2:16 pm
Posts: 81
Hibernate version:
2.1.3
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class name = "relatorios.Utilizador" table = "utilizadores">
<id name = "id" column = "id" unsaved-value = "null">
<generator class = "increment" />
</id>
<many-to-one
name = "relatorio"
column = "rel_relatorios"
class = "relatorios.Relatorio"
cascade = "all">
</many-to-one>
<property name = "nomeUtilizador" column = "nomeUtilizador" />
<property name = "nomeCompleto" column = "nomeCompleto" />
<property name = "palavraPasse" column = "palavraPasse" />
<property name = "perfil" column = "perfil" />
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
//...
Session sess = Utilitarios.currentSession ();
sess.clear(); // NonUniqueObjectException
sess.update ( ut ); // LazyInitializationException
visual.lmQ9.removeAllElements ();
Iterator iter = ut.getRelatorio ().getTurma ().getQ9 ().iterator ();
while ( iter.hasNext () ) {
visual.lmQ9.addElement ( iter.next () );
}
//...
Full stack trace of any exception that occurs:
net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 2, of class: relatorios.Utilizador
at net.sf.hibernate.impl.SessionImpl.checkUniqueness(SessionImpl.java:1666)
at net.sf.hibernate.impl.SessionImpl.doUpdateMutable(SessionImpl.java:1435)
at net.sf.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:1462)
at net.sf.hibernate.impl.SessionImpl.update(SessionImpl.java:1347)
at bd.Arquivador.povoaTudo(Arquivador.java:355)
at gui.FrameAplicacao.<init>(FrameAplicacao.java:983)
at gui.Aplicacao.<init>(Aplicacao.java:14)
at gui.FrameLogin.jButtonEntrar_actionPerformed(FrameLogin.java:132)
at gui.FrameLogin$FrameLogin_jButtonEntrar_actionAdapter.actionPerformed(FrameLogin.java:156)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Name and version of the database you are using:
MySql 4.0.12
The generated SQL (show_sql=true):
Hibernate: select acessorios0_.id as id, acessorios0_.epocaActual as epocaAct2_ from acessorios acessorios0_
Hibernate: select utilizador0_.id as id, utilizador0_.rel_relatorios as rel_rela2_, utilizador0_.nomeUtilizador as nomeUtil3_, utilizador0_.nomeCompleto as nomeComp4_, utilizador0_.palavraPasse as palavraP5_, utilizador0_.perfil as perfil from utilizadores utilizador0_, relatorios relatorio1_, turmas turma2_ where (utilizador0_.palavraPasse=? )AND(utilizador0_.nomeUtilizador=? )AND(turma2_.q1=? and utilizador0_.rel_relatorios=relatorio1_.id and relatorio1_.rel_turmas=turma2_.id)
Hibernate: select acessorios0_.id as id, acessorios0_.epocaActual as epocaAct2_ from acessorios acessorios0_
Hibernate: select utilizador0_.id as id, utilizador0_.rel_relatorios as rel_rela2_, utilizador0_.nomeUtilizador as nomeUtil3_, utilizador0_.nomeCompleto as nomeComp4_, utilizador0_.palavraPasse as palavraP5_, utilizador0_.perfil as perfil from utilizadores utilizador0_ where (utilizador0_.palavraPasse=? )AND(utilizador0_.nomeUtilizador=? )AND(utilizador0_.perfil=? )
Hibernate: select acessorios0_.id as id, acessorios0_.epocaActual as epocaAct2_ from acessorios acessorios0_
Hibernate: select utilizador0_.id as id, utilizador0_.rel_relatorios as rel_rela2_, utilizador0_.nomeUtilizador as nomeUtil3_, utilizador0_.nomeCompleto as nomeComp4_, utilizador0_.palavraPasse as palavraP5_, utilizador0_.perfil as perfil from utilizadores utilizador0_, relatorios relatorio1_, turmas turma2_ where (utilizador0_.palavraPasse=? )AND(utilizador0_.nomeUtilizador=? )AND(turma2_.q1=? and utilizador0_.rel_relatorios=relatorio1_.id and relatorio1_.rel_turmas=turma2_.id)
Hibernate: select relatorio0_.id as id0_, relatorio0_.rel_turmas as rel_turmas0_, relatorio0_.rel_cienciasDaNatureza as rel_cien3_0_, relatorio0_.rel_cienciasFisicoQuimicas as rel_cien4_0_, relatorio0_.rel_cienciasNaturais as rel_cien5_0_, relatorio0_.rel_educacaoArtistica as rel_educ6_0_, relatorio0_.rel_educacaoFisica as rel_educ7_0_, relatorio0_.rel_educacaoMoralEReligiosa as rel_educ8_0_, relatorio0_.rel_educacaoMusical as rel_educ9_0_, relatorio0_.rel_educacaoTecnologica as rel_edu10_0_, relatorio0_.rel_educacaoVisual as rel_edu11_0_, relatorio0_.rel_educacaoVisualETecnologica as rel_edu12_0_, relatorio0_.rel_estudoDoMeio as rel_est13_0_, relatorio0_.rel_expressaoArtistica as rel_exp14_0_, relatorio0_.rel_expressaoFisicoMotora as rel_exp15_0_, relatorio0_.rel_geografia as rel_geo16_0_, relatorio0_.rel_historia as rel_his17_0_, relatorio0_.rel_historiaEGeografiaDePortugal as rel_his18_0_, relatorio0_.rel_matematica as rel_mat19_0_, relatorio0_.rel_linguaPortuguesa as rel_lin20_0_, relatorio0_.rel_leI as rel_leI0_, relatorio0_.rel_leII as rel_leII0_, relatorio0_.rel_tic as rel_tic0_ from relatorios relatorio0_ where relatorio0_.id=?
Hibernate: select turma0_.id as id0_, turma0_.obs as obs0_, turma0_.autor as autor0_, turma0_.ciclo as ciclo0_, turma0_.leI as leI0_, turma0_.leII as leII0_, turma0_.q1 as q10_, turma0_.q2 as q20_, turma0_.q3 as q30_, turma0_.q4 as q40_, turma0_.q5 as q50_, turma0_.q6 as q60_, turma0_.q7 as q70_, turma0_.q8 as q80_, turma0_.q16 as q160_, turma0_.q18 as q180_, turma0_.q24 as q240_, turma0_.q24a as q24a0_, turma0_.q25 as q250_, turma0_.q26 as q260_, turma0_.q27 as q270_, turma0_.q28 as q280_, turma0_.q29 as q290_, turma0_.q30 as q300_, turma0_.q31 as q310_, turma0_.q32 as q320_, turma0_.q33_1 as q33_10_, turma0_.q33_2 as q33_20_, turma0_.q33_3 as q33_30_, turma0_.q33_4 as q33_40_, turma0_.q33_5 as q33_50_, turma0_.q33_6 as q33_60_, turma0_.q33_7 as q33_70_, turma0_.q33_8 as q33_80_, turma0_.q33_9 as q33_90_, turma0_.q33_10 as q33_100_, turma0_.q33_11 as q33_110_, turma0_.q33_12 as q33_120_, turma0_.q33a_1 as q33a_10_, turma0_.q33a_2 as q33a_20_, turma0_.q33a_3 as q33a_30_, turma0_.q33a_4 as q33a_40_, turma0_.q33a_5 as q33a_50_, turma0_.q33a_6 as q33a_60_, turma0_.q33a_7 as q33a_70_, turma0_.q33a_8 as q33a_80_, turma0_.q33a_9 as q33a_90_, turma0_.q33a_10 as q33a_100_, turma0_.q33a_11 as q33a_110_, turma0_.q33a_12 as q33a_120_, turma0_.q35 as q350_, turma0_.q36 as q360_, turma0_.q37 as q370_, turma0_.q38 as q380_, turma0_.q41_EE as q41_EE0_, turma0_.q41_Al as q41_Al0_, turma0_.q42 as q420_, turma0_.q43 as q430_, turma0_.q44 as q440_, turma0_.q45_1 as q45_10_, turma0_.q45_2 as q45_20_, turma0_.q45_3 as q45_30_, turma0_.q45_4 as q45_40_, turma0_.q45_5 as q45_50_, turma0_.q45_6 as q45_60_, turma0_.q45_7 as q45_70_, turma0_.q47 as q470_, turma0_.q48 as q480_, turma0_.q49 as q490_, turma0_.q50 as q500_, turma0_.q51 as q510_, turma0_.q51a as q51a0_, turma0_.q52 as q520_, turma0_.q53 as q530_, turma0_.q54 as q540_, turma0_.q55 as q550_, turma0_.q56 as q560_, turma0_.q57 as q570_, turma0_.q58 as q580_, turma0_.q59 as q590_, turma0_.q60 as q600_, turma0_.q60a as q60a0_, turma0_.q61 as q610_, turma0_.q62 as q620_, turma0_.q74 as q740_, turma0_.q76 as q760_, turma0_.q77 as q770_, turma0_.q78 as q780_, turma0_.q79 as q790_, turma0_.q80 as q800_, turma0_.q82 as q820_, turma0_.q83 as q830_, turma0_.q84 as q840_, turma0_.q86 as q860_, turma0_.q87 as q870_, turma0_.q88 as q880_, turma0_.q89 as q890_, turma0_.q90 as q900_, turma0_.q91 as q910_, turma0_.q93 as q930_, turma0_.q94 as q940_ from turmas turma0_ where turma0_.id=?
Hibernate: select cienciasda0_.id as id0_ from cienciasDaNatureza cienciasda0_ where cienciasda0_.id=?
Hibernate: select cienciasfi0_.id as id0_ from cienciasFisicoQuimicas cienciasfi0_ where cienciasfi0_.id=?
Hibernate: select cienciasna0_.id as id0_ from cienciasNaturais cienciasna0_ where cienciasna0_.id=?
Hibernate: select educacaoar0_.id as id0_ from educacaoArtistica educacaoar0_ where educacaoar0_.id=?
Hibernate: select educacaofi0_.id as id0_ from educacaoFisica educacaofi0_ where educacaofi0_.id=?
Hibernate: select educacaomo0_.id as id0_ from educacaoMoralEReligiosa educacaomo0_ where educacaomo0_.id=?
Hibernate: select educacaomu0_.id as id0_ from educacaoMusical educacaomu0_ where educacaomu0_.id=?
Hibernate: select educacaote0_.id as id0_ from educacaoTecnologica educacaote0_ where educacaote0_.id=?
Hibernate: select educacaovi0_.id as id0_ from educacaoVisual educacaovi0_ where educacaovi0_.id=?
Hibernate: select educacaovi0_.id as id0_ from educacaoVisualETecnologica educacaovi0_ where educacaovi0_.id=?
Hibernate: select estudodome0_.id as id0_ from estudoDoMeio estudodome0_ where estudodome0_.id=?
Hibernate: select expressaoa0_.id as id0_ from expressaoArtistica expressaoa0_ where expressaoa0_.id=?
Hibernate: select expressaof0_.id as id0_ from expressaoFisicoMotora expressaof0_ where expressaof0_.id=?
Hibernate: select geografia0_.id as id0_ from geografia geografia0_ where geografia0_.id=?
Hibernate: select historia0_.id as id0_ from historia historia0_ where historia0_.id=?
Hibernate: select historiaeg0_.id as id0_ from historiaEGeografiaDePortugal historiaeg0_ where historiaeg0_.id=?
Hibernate: select matematica0_.id as id0_ from matematica matematica0_ where matematica0_.id=?
Hibernate: select linguaport0_.id as id0_ from linguaPortuguesa linguaport0_ where linguaport0_.id=?
Hibernate: select lei0_.id as id0_ from leI lei0_ where lei0_.id=?
Hibernate: select leii0_.id as id0_ from leII leii0_ where leii0_.id=?
Hibernate: select tic0_.id as id0_ from tic tic0_ where tic0_.id=?
Hibernate: select distinct turma0_.q1 as x0_0_ from turmas turma0_ order by turma0_.q1 asc
Hibernate: select utilizador0_.id as id, utilizador0_.rel_relatorios as rel_rela2_, utilizador0_.nomeUtilizador as nomeUtil3_, utilizador0_.nomeCompleto as nomeComp4_, utilizador0_.palavraPasse as palavraP5_, utilizador0_.perfil as perfil from utilizadores utilizador0_, relatorios relatorio1_, turmas turma2_ where utilizador0_.rel_relatorios=relatorio1_.id and relatorio1_.rel_turmas=turma2_.id and ((turma2_.q1=? and utilizador0_.rel_relatorios=relatorio1_.id and relatorio1_.rel_turmas=turma2_.id)) order by turma2_.q2 asc , turma2_.q3 asc
Hibernate: select relatorio0_.id as id0_, relatorio0_.rel_turmas as rel_turmas0_, relatorio0_.rel_cienciasDaNatureza as rel_cien3_0_, relatorio0_.rel_cienciasFisicoQuimicas as rel_cien4_0_, relatorio0_.rel_cienciasNaturais as rel_cien5_0_, relatorio0_.rel_educacaoArtistica as rel_educ6_0_, relatorio0_.rel_educacaoFisica as rel_educ7_0_, relatorio0_.rel_educacaoMoralEReligiosa as rel_educ8_0_, relatorio0_.rel_educacaoMusical as rel_educ9_0_, relatorio0_.rel_educacaoTecnologica as rel_edu10_0_, relatorio0_.rel_educacaoVisual as rel_edu11_0_, relatorio0_.rel_educacaoVisualETecnologica as rel_edu12_0_, relatorio0_.rel_estudoDoMeio as rel_est13_0_, relatorio0_.rel_expressaoArtistica as rel_exp14_0_, relatorio0_.rel_expressaoFisicoMotora as rel_exp15_0_, relatorio0_.rel_geografia as rel_geo16_0_, relatorio0_.rel_historia as rel_his17_0_, relatorio0_.rel_historiaEGeografiaDePortugal as rel_his18_0_, relatorio0_.rel_matematica as rel_mat19_0_, relatorio0_.rel_linguaPortuguesa as rel_lin20_0_, relatorio0_.rel_leI as rel_leI0_, relatorio0_.rel_leII as rel_leII0_, relatorio0_.rel_tic as rel_tic0_ from relatorios relatorio0_ where relatorio0_.id=?
Hibernate: select turma0_.id as id0_, turma0_.obs as obs0_, turma0_.autor as autor0_, turma0_.ciclo as ciclo0_, turma0_.leI as leI0_, turma0_.leII as leII0_, turma0_.q1 as q10_, turma0_.q2 as q20_, turma0_.q3 as q30_, turma0_.q4 as q40_, turma0_.q5 as q50_, turma0_.q6 as q60_, turma0_.q7 as q70_, turma0_.q8 as q80_, turma0_.q16 as q160_, turma0_.q18 as q180_, turma0_.q24 as q240_, turma0_.q24a as q24a0_, turma0_.q25 as q250_, turma0_.q26 as q260_, turma0_.q27 as q270_, turma0_.q28 as q280_, turma0_.q29 as q290_, turma0_.q30 as q300_, turma0_.q31 as q310_, turma0_.q32 as q320_, turma0_.q33_1 as q33_10_, turma0_.q33_2 as q33_20_, turma0_.q33_3 as q33_30_, turma0_.q33_4 as q33_40_, turma0_.q33_5 as q33_50_, turma0_.q33_6 as q33_60_, turma0_.q33_7 as q33_70_, turma0_.q33_8 as q33_80_, turma0_.q33_9 as q33_90_, turma0_.q33_10 as q33_100_, turma0_.q33_11 as q33_110_, turma0_.q33_12 as q33_120_, turma0_.q33a_1 as q33a_10_, turma0_.q33a_2 as q33a_20_, turma0_.q33a_3 as q33a_30_, turma0_.q33a_4 as q33a_40_, turma0_.q33a_5 as q33a_50_, turma0_.q33a_6 as q33a_60_, turma0_.q33a_7 as q33a_70_, turma0_.q33a_8 as q33a_80_, turma0_.q33a_9 as q33a_90_, turma0_.q33a_10 as q33a_100_, turma0_.q33a_11 as q33a_110_, turma0_.q33a_12 as q33a_120_, turma0_.q35 as q350_, turma0_.q36 as q360_, turma0_.q37 as q370_, turma0_.q38 as q380_, turma0_.q41_EE as q41_EE0_, turma0_.q41_Al as q41_Al0_, turma0_.q42 as q420_, turma0_.q43 as q430_, turma0_.q44 as q440_, turma0_.q45_1 as q45_10_, turma0_.q45_2 as q45_20_, turma0_.q45_3 as q45_30_, turma0_.q45_4 as q45_40_, turma0_.q45_5 as q45_50_, turma0_.q45_6 as q45_60_, turma0_.q45_7 as q45_70_, turma0_.q47 as q470_, turma0_.q48 as q480_, turma0_.q49 as q490_, turma0_.q50 as q500_, turma0_.q51 as q510_, turma0_.q51a as q51a0_, turma0_.q52 as q520_, turma0_.q53 as q530_, turma0_.q54 as q540_, turma0_.q55 as q550_, turma0_.q56 as q560_, turma0_.q57 as q570_, turma0_.q58 as q580_, turma0_.q59 as q590_, turma0_.q60 as q600_, turma0_.q60a as q60a0_, turma0_.q61 as q610_, turma0_.q62 as q620_, turma0_.q74 as q740_, turma0_.q76 as q760_, turma0_.q77 as q770_, turma0_.q78 as q780_, turma0_.q79 as q790_, turma0_.q80 as q800_, turma0_.q82 as q820_, turma0_.q83 as q830_, turma0_.q84 as q840_, turma0_.q86 as q860_, turma0_.q87 as q870_, turma0_.q88 as q880_, turma0_.q89 as q890_, turma0_.q90 as q900_, turma0_.q91 as q910_, turma0_.q93 as q930_, turma0_.q94 as q940_ from turmas turma0_ where turma0_.id=?
Hibernate: select cienciasda0_.id as id0_ from cienciasDaNatureza cienciasda0_ where cienciasda0_.id=?
Hibernate: select cienciasfi0_.id as id0_ from cienciasFisicoQuimicas cienciasfi0_ where cienciasfi0_.id=?
Hibernate: select cienciasna0_.id as id0_ from cienciasNaturais cienciasna0_ where cienciasna0_.id=?
Hibernate: select educacaoar0_.id as id0_ from educacaoArtistica educacaoar0_ where educacaoar0_.id=?
Hibernate: select educacaofi0_.id as id0_ from educacaoFisica educacaofi0_ where educacaofi0_.id=?
Hibernate: select educacaomo0_.id as id0_ from educacaoMoralEReligiosa educacaomo0_ where educacaomo0_.id=?
Hibernate: select educacaomu0_.id as id0_ from educacaoMusical educacaomu0_ where educacaomu0_.id=?
Hibernate: select educacaote0_.id as id0_ from educacaoTecnologica educacaote0_ where educacaote0_.id=?
Hibernate: select educacaovi0_.id as id0_ from educacaoVisual educacaovi0_ where educacaovi0_.id=?
Hibernate: select educacaovi0_.id as id0_ from educacaoVisualETecnologica educacaovi0_ where educacaovi0_.id=?
Hibernate: select estudodome0_.id as id0_ from estudoDoMeio estudodome0_ where estudodome0_.id=?
Hibernate: select expressaoa0_.id as id0_ from expressaoArtistica expressaoa0_ where expressaoa0_.id=?
Hibernate: select expressaof0_.id as id0_ from expressaoFisicoMotora expressaof0_ where expressaof0_.id=?
Hibernate: select geografia0_.id as id0_ from geografia geografia0_ where geografia0_.id=?
Hibernate: select historia0_.id as id0_ from historia historia0_ where historia0_.id=?
Hibernate: select historiaeg0_.id as id0_ from historiaEGeografiaDePortugal historiaeg0_ where historiaeg0_.id=?
Hibernate: select matematica0_.id as id0_ from matematica matematica0_ where matematica0_.id=?
Hibernate: select linguaport0_.id as id0_ from linguaPortuguesa linguaport0_ where linguaport0_.id=?
Hibernate: select lei0_.id as id0_ from leI lei0_ where lei0_.id=?
Hibernate: select leii0_.id as id0_ from leII leii0_ where leii0_.id=?
Hibernate: select tic0_.id as id0_ from tic tic0_ where tic0_.id=?
Hibernate: select relatorio0_.id as id0_, relatorio0_.rel_turmas as rel_turmas0_, relatorio0_.rel_cienciasDaNatureza as rel_cien3_0_, relatorio0_.rel_cienciasFisicoQuimicas as rel_cien4_0_, relatorio0_.rel_cienciasNaturais as rel_cien5_0_, relatorio0_.rel_educacaoArtistica as rel_educ6_0_, relatorio0_.rel_educacaoFisica as rel_educ7_0_, relatorio0_.rel_educacaoMoralEReligiosa as rel_educ8_0_, relatorio0_.rel_educacaoMusical as rel_educ9_0_, relatorio0_.rel_educacaoTecnologica as rel_edu10_0_, relatorio0_.rel_educacaoVisual as rel_edu11_0_, relatorio0_.rel_educacaoVisualETecnologica as rel_edu12_0_, relatorio0_.rel_estudoDoMeio as rel_est13_0_, relatorio0_.rel_expressaoArtistica as rel_exp14_0_, relatorio0_.rel_expressaoFisicoMotora as rel_exp15_0_, relatorio0_.rel_geografia as rel_geo16_0_, relatorio0_.rel_historia as rel_his17_0_, relatorio0_.rel_historiaEGeografiaDePortugal as rel_his18_0_, relatorio0_.rel_matematica as rel_mat19_0_, relatorio0_.rel_linguaPortuguesa as rel_lin20_0_, relatorio0_.rel_leI as rel_leI0_, relatorio0_.rel_leII as rel_leII0_, relatorio0_.rel_tic as rel_tic0_ from relatorios relatorio0_ where relatorio0_.id=?
Hibernate: select turma0_.id as id0_, turma0_.obs as obs0_, turma0_.autor as autor0_, turma0_.ciclo as ciclo0_, turma0_.leI as leI0_, turma0_.leII as leII0_, turma0_.q1 as q10_, turma0_.q2 as q20_, turma0_.q3 as q30_, turma0_.q4 as q40_, turma0_.q5 as q50_, turma0_.q6 as q60_, turma0_.q7 as q70_, turma0_.q8 as q80_, turma0_.q16 as q160_, turma0_.q18 as q180_, turma0_.q24 as q240_, turma0_.q24a as q24a0_, turma0_.q25 as q250_, turma0_.q26 as q260_, turma0_.q27 as q270_, turma0_.q28 as q280_, turma0_.q29 as q290_, turma0_.q30 as q300_, turma0_.q31 as q310_, turma0_.q32 as q320_, turma0_.q33_1 as q33_10_, turma0_.q33_2 as q33_20_, turma0_.q33_3 as q33_30_, turma0_.q33_4 as q33_40_, turma0_.q33_5 as q33_50_, turma0_.q33_6 as q33_60_, turma0_.q33_7 as q33_70_, turma0_.q33_8 as q33_80_, turma0_.q33_9 as q33_90_, turma0_.q33_10 as q33_100_, turma0_.q33_11 as q33_110_, turma0_.q33_12 as q33_120_, turma0_.q33a_1 as q33a_10_, turma0_.q33a_2 as q33a_20_, turma0_.q33a_3 as q33a_30_, turma0_.q33a_4 as q33a_40_, turma0_.q33a_5 as q33a_50_, turma0_.q33a_6 as q33a_60_, turma0_.q33a_7 as q33a_70_, turma0_.q33a_8 as q33a_80_, turma0_.q33a_9 as q33a_90_, turma0_.q33a_10 as q33a_100_, turma0_.q33a_11 as q33a_110_, turma0_.q33a_12 as q33a_120_, turma0_.q35 as q350_, turma0_.q36 as q360_, turma0_.q37 as q370_, turma0_.q38 as q380_, turma0_.q41_EE as q41_EE0_, turma0_.q41_Al as q41_Al0_, turma0_.q42 as q420_, turma0_.q43 as q430_, turma0_.q44 as q440_, turma0_.q45_1 as q45_10_, turma0_.q45_2 as q45_20_, turma0_.q45_3 as q45_30_, turma0_.q45_4 as q45_40_, turma0_.q45_5 as q45_50_, turma0_.q45_6 as q45_60_, turma0_.q45_7 as q45_70_, turma0_.q47 as q470_, turma0_.q48 as q480_, turma0_.q49 as q490_, turma0_.q50 as q500_, turma0_.q51 as q510_, turma0_.q51a as q51a0_, turma0_.q52 as q520_, turma0_.q53 as q530_, turma0_.q54 as q540_, turma0_.q55 as q550_, turma0_.q56 as q560_, turma0_.q57 as q570_, turma0_.q58 as q580_, turma0_.q59 as q590_, turma0_.q60 as q600_, turma0_.q60a as q60a0_, turma0_.q61 as q610_, turma0_.q62 as q620_, turma0_.q74 as q740_, turma0_.q76 as q760_, turma0_.q77 as q770_, turma0_.q78 as q780_, turma0_.q79 as q790_, turma0_.q80 as q800_, turma0_.q82 as q820_, turma0_.q83 as q830_, turma0_.q84 as q840_, turma0_.q86 as q860_, turma0_.q87 as q870_, turma0_.q88 as q880_, turma0_.q89 as q890_, turma0_.q90 as q900_, turma0_.q91 as q910_, turma0_.q93 as q930_, turma0_.q94 as q940_ from turmas turma0_ where turma0_.id=?
Hibernate: select cienciasda0_.id as id0_ from cienciasDaNatureza cienciasda0_ where cienciasda0_.id=?
Hibernate: select cienciasfi0_.id as id0_ from cienciasFisicoQuimicas cienciasfi0_ where cienciasfi0_.id=?
Hibernate: select cienciasna0_.id as id0_ from cienciasNaturais cienciasna0_ where cienciasna0_.id=?
Hibernate: select educacaoar0_.id as id0_ from educacaoArtistica educacaoar0_ where educacaoar0_.id=?
Hibernate: select educacaofi0_.id as id0_ from educacaoFisica educacaofi0_ where educacaofi0_.id=?
Hibernate: select educacaomo0_.id as id0_ from educacaoMoralEReligiosa educacaomo0_ where educacaomo0_.id=?
Hibernate: select educacaomu0_.id as id0_ from educacaoMusical educacaomu0_ where educacaomu0_.id=?
Hibernate: select educacaote0_.id as id0_ from educacaoTecnologica educacaote0_ where educacaote0_.id=?
Hibernate: select educacaovi0_.id as id0_ from educacaoVisual educacaovi0_ where educacaovi0_.id=?
Hibernate: select educacaovi0_.id as id0_ from educacaoVisualETecnologica educacaovi0_ where educacaovi0_.id=?
Hibernate: select estudodome0_.id as id0_ from estudoDoMeio estudodome0_ where estudodome0_.id=?
Hibernate: select expressaoa0_.id as id0_ from expressaoArtistica expressaoa0_ where expressaoa0_.id=?
Hibernate: select expressaof0_.id as id0_ from expressaoFisicoMotora expressaof0_ where expressaof0_.id=?
Hibernate: select geografia0_.id as id0_ from geografia geografia0_ where geografia0_.id=?
Hibernate: select historia0_.id as id0_ from historia historia0_ where historia0_.id=?
Hibernate: select historiaeg0_.id as id0_ from historiaEGeografiaDePortugal historiaeg0_ where historiaeg0_.id=?
Hibernate: select matematica0_.id as id0_ from matematica matematica0_ where matematica0_.id=?
Hibernate: select linguaport0_.id as id0_ from linguaPortuguesa linguaport0_ where linguaport0_.id=?
Hibernate: select lei0_.id as id0_ from leI lei0_ where lei0_.id=?
Hibernate: select leii0_.id as id0_ from leII leii0_ where leii0_.id=?
Hibernate: select tic0_.id as id0_ from tic tic0_ where tic0_.id=?
Debug level Hibernate log excerpt:

Having read the forums and faq, in order to avoid a

LazyInitializationException i added:
Code:
sess.update ( ut );


I've a login that, if succeded, saves my user ut in a static var.
User is my top obj.
When logingin, if i dont make a mistake, everything goes fine, but if i log in wrongly at first and the right next, i get the dreaded NonUniqueObjectException.
In order to avoid it, i added to my code:
Code:
        sess.clear();

and this works fine so far.
My Q:
am i doing things the right way?
Because i'm afraid this might have consequences i cant foresee...
Thanks in advance


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.