Giter Club home page Giter Club logo

Comments (3)

Jesse1205 avatar Jesse1205 commented on July 22, 2024

How about this link Jesse1205/ScutGame@8cc4ab9
can solve your problem?

from scut.

kybird avatar kybird commented on July 22, 2024

this problem will happen when the entity have more than two key..
and you will see log like below.

EntitySync queue key Entity-1-0-0 faild object is null
EntitySync queue key Entity-1-1-0 faild object is null

here is my solution
It delay Notify Event until finish setting data to Entity
anyway i need to check your changes.
thanks for share!!

SqlDataReceiver.cs

 	private T ReadEntityProperty<T>(IDataReader reader, EntityPropertySetFunc<T> setFunc) where T :  new()
 	{
 		T entity = new T();

 		var disableNotify = entity as EntityChangeEvent; //added
 		if (disableNotify != null) disableNotify.DelayNotify(); //added
 		var columns = _schema.GetColumns();
 		foreach (var column in columns)
 		{
 			try
 			{
 				object fieldValue = reader[column.Name];
 				if (setFunc != null) setFunc(entity, column, fieldValue);
 			}
 			catch (Exception ex)
 			{
 				throw new Exception(string.Format("read {0} table's {1} column error.", _schema.EntityName, column.Name), ex);
 			}
 		}
 		if (disableNotify != null) disableNotify.TriggerNotify(); //added 
 		return entity;
 	}

from scut.

kybird avatar kybird commented on July 22, 2024

@Jesse1205 Can you describe the problem that apply your solution?

i test original TryGetCacheItem. and its lazy anonymous delegate never executed.

from scut.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.