-->
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: deletes from database but keeps it in cache
PostPosted: Fri Jul 14, 2006 1:49 am 
Beginner
Beginner

Joined: Thu Oct 06, 2005 8:14 pm
Posts: 23
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version:[/b]

[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using:[/b]

[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]

Hi All

I am experiencing a very weird behaviour from hibernate...

I have a class and its been subclassed now I delete the subclass in my testcase it deletes correctlky but the problem is that it somehow still retrieves the same object though its no more in the db>????

it shoud lrightly throw some objct not foundexception.......
Please find below the snippet of hbm.xml

hibernate-mapping package="a">
<class name="CreditCard" table="CreditCard" lazy="true">
<id name="cardNumber" type="string" column="CardNumber">
<generator class="assigned" />
</id>
<!-- =============INHERITANCE PersonalCreditCard============ -->
<joined-subclass name="PersonalCreditCard"
table="PersonalCreditCard">
<key column="CardNumber" />
</joined-subclass>


</class>
</hibernate-mapping>

Now I delete this in my test case and it gotes from the db it correctly fires the deletes


Hibernate: select personalcr0_.CardNumber as CardNumber0_ from PersonalCreditCard personalcr0_ inner join CreditCard personalcr0_1_ on personalcr0_.CardNumber=personalcr0_1_.CardNumber where personalcr0_.CardNumber=?
Hibernate: delete from PersonalCreditCard where CardNumber=?
Hibernate: delete from CreditCard where CardNumber=?


Unit test

junit.framework.AssertionFailedError: Able to retrieve a deleted card there is something wrong here check card45343-555



Any ideas wahts happening?
Regards
Subu


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.