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: First call to update doesn't recognise dirty data
PostPosted: Thu Oct 23, 2008 11:32 am 
Newbie

Joined: Thu Oct 23, 2008 10:00 am
Posts: 3
Hello,

Another noob question I'm, afraid.

I have a messaging system. I also have a Subscriber object which has a Stats object as one of its properties. When a message is received from a new subscriber it creates an entry in the subscriber table and an entry in the stats table. However, when I update a stat and call Update nothing happens, see 1st trace. When another message is sent in the exact same code is called but I can see the update occurring in the trace, see 2nd trace.

I'd appreciate if anyone could point me in the right direction.

Thanks.


Hibernate version: 1.2.1

Mapping documents: None

Code between sessionFactory.openSession() and session.close():
ISession session = NHibernateTransactionManager.StartSession();
session.Update(entity);

NHibernateTransactionManager.FlushSession();

session.Refresh(entity);
Full stack trace of any exception that occurs:

Name and version of the database you are using:
Sql Server 9

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:
1st bit



2008-10-23 12:22:22,062 [1] DEBUG BetNow.Core.Persist.NHibernateDb.Subscription - Update()
2008-10-23 12:22:22,062 [1] DEBUG BetNow.Core.Persist.NHibernateTransactionManager - StartSession()
2008-10-23 12:22:22,062 [1] DEBUG BetNow.Core.Persist.NHibernateHelper - GetCurrentSession()
2008-10-23 12:22:22,062 [1] DEBUG NHibernate.Transaction.AdoTransaction - begin
2008-10-23 12:22:22,062 [1] DEBUG NHibernate.Connection.DriverConnectionProvider - Obtaining IDbConnection from Driver
2008-10-23 12:22:22,078 [1] DEBUG NHibernate.Impl.SessionImpl - updating [BetNow.Core.Subscription#6b541692-0c29-4559-ba0e-1a8ed32fe404]
2008-10-23 12:22:22,078 [1] DEBUG BetNow.Core.Persist.NHibernateTransactionManager - FlushSession()
2008-10-23 12:22:22,078 [1] DEBUG BetNow.Core.Persist.NHibernateHelper - GetCurrentSession()
2008-10-23 12:22:22,078 [1] DEBUG NHibernate.Transaction.AdoTransaction - commit
2008-10-23 12:22:22,078 [1] DEBUG NHibernate.Impl.SessionImpl - flushing session
2008-10-23 12:22:22,078 [1] DEBUG NHibernate.Impl.SessionImpl - Flushing entities and processing referenced collections
2008-10-23 12:22:22,078 [1] DEBUG NHibernate.Impl.SessionImpl - Updating entity: [BetNow.Core.Subscription#6b541692-0c29-4559-ba0e-1a8ed32fe404]
2008-10-23 12:22:22,078 [1] DEBUG NHibernate.Impl.SessionImpl - Processing unreferenced collections
2008-10-23 12:22:22,078 [1] DEBUG NHibernate.Impl.SessionImpl - scheduling collection removes/(re)creates/updates
2008-10-23 12:22:22,078 [1] DEBUG NHibernate.Impl.SessionImpl - Flushed: 0 insertions, 1 updates, 0 deletions to 139 objects
2008-10-23 12:22:22,078 [1] DEBUG NHibernate.Impl.SessionImpl - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2008-10-23 12:22:22,078 [1] DEBUG NHibernate.Impl.Printer - listing entities:



2nd bit


2008-10-23 12:26:02,765 [1] DEBUG BetNow.Core.Persist.NHibernateDb.Subscription - Update()
2008-10-23 12:26:02,765 [1] DEBUG BetNow.Core.Persist.NHibernateTransactionManager - StartSession()
2008-10-23 12:26:02,765 [1] DEBUG BetNow.Core.Persist.NHibernateHelper - GetCurrentSession()
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Transaction.AdoTransaction - begin
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Connection.DriverConnectionProvider - Obtaining IDbConnection from Driver
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Impl.SessionImpl - object already associated with session
2008-10-23 12:26:02,765 [1] DEBUG BetNow.Core.Persist.NHibernateTransactionManager - FlushSession()
2008-10-23 12:26:02,765 [1] DEBUG BetNow.Core.Persist.NHibernateHelper - GetCurrentSession()
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Transaction.AdoTransaction - commit
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Impl.SessionImpl - flushing session
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Impl.SessionImpl - Flushing entities and processing referenced collections
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.FirstMessageDate is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.FirstMessageText is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.Last10MessagesString is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.LastMessageDate is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.LastMessageText is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.MessageCount is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.MessageCountSinceLastBet is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Impl.SessionImpl - Updating entity: [BetNow.Core.SubscriberStatsData#6b541692-0c29-4559-ba0e-1a8ed32fe404]
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.FirstMessageDate is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.FirstMessageText is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.Last10MessagesString is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.LastMessageDate is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.LastMessageText is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.MessageCount is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.MessageCountSinceLastBet is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Persister.Entity.AbstractEntityPersister - BetNow.Core.SubscriberStatsData.LastUpdated is dirty
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Engine.Versioning - Incrementing: 2 to 3
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Impl.SessionImpl - Processing unreferenced collections
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Impl.SessionImpl - scheduling collection removes/(re)creates/updates
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Impl.SessionImpl - Flushed: 0 insertions, 1 updates, 0 deletions to 16 objects
2008-10-23 12:26:02,765 [1] DEBUG NHibernate.Impl.SessionImpl - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections

Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


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.