I faced with case that is very strange for me.
I have class A that contains method
public string GetProperty(string propertyKey)
{
...
var properties = Dao.GetAllByPropertyValue<IProperty, string>(propertyKey, p => p.PropertyName);
..
}
and property public IPropertiesManager PropertiesManager { get; set; } with class that contains the same method. This property's class is initialized in constructor of A class with transferring of DAO to it.
On starting of my application Spring creates some classes and class A as well.
After that I call a.GetProperty(PROPERTYNAME) or a.PropertiesManager.GetProperty(PROPERTYNAME); (I need implement only this variant but first method is for test)
Unclear behavior for me is that in the first case everything works fine but in the second one it throws exception "No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here". At the same time there is only thread and it is not changed during initialization and my calling of method. I could not understand why it is so and how I could fix it.
Aucun commentaire:
Enregistrer un commentaire