|
From: Sławomir R. (J. <nh...@gm...> - 2011-01-18 14:57:25
|
Lazy-loading doesn't work with cache
------------------------------------
Key: NH-2510
URL: http://216.121.112.228/browse/NH-2510
Project: NHibernate
Issue Type: Bug
Components: Core
Affects Versions: 3.0.0.GA
Reporter: Sławomir Rosiek
Priority: Minor
If I set caching in entity which has lazy property I have the following exception:
System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.Byte[]'.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Fabio M. (JIRA) <nh...@gm...> - 2011-03-28 20:16:27
|
[ http://216.121.112.228/browse/NH-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20782#action_20782 ]
Fabio Maulo commented on NH-2510:
---------------------------------
We need a failing test or at least pseudo-domain-classes,mappings and a chunk of code to see the exception.
Thanks.
check this link if you want provide a failing test
http://nhforge.org/blogs/nhibernate/archive/2008/10/04/the-best-way-to-solve-nhibernate-bugs-submit-good-unit-test.aspx
> Lazy-loading doesn't work with cache
> ------------------------------------
>
> Key: NH-2510
> URL: http://216.121.112.228/browse/NH-2510
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.GA
> Reporter: Sławomir Rosiek
> Priority: Minor
>
> If I set caching in entity which has lazy property I have the following exception:
> System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.Byte[]'.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Alexey G. (JIRA) <nh...@gm...> - 2011-05-06 20:03:07
|
[ http://216.121.112.228/browse/NH-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Gorbach updated NH-2510:
-------------------------------
Attachment: NH2510-Fixture.patch
Hi!
This patch adds failing unit test to current trunk. It throws following exception:
System.InvalidCastException : Unable to cast object of type 'System.Object' to type 'System.Byte[]'.
at NHibernate.Type.BinaryType.ToInternalFormat(Object bytes) in BinaryType.cs: line 39
at NHibernate.Type.AbstractBinaryType.DeepCopyNotNull(Object value) in AbstractBinaryType.cs: line 148
at NHibernate.Type.MutableType.DeepCopy(Object value, EntityMode entityMode, ISessionFactoryImplementor factory) in MutableType.cs: line 48
at NHibernate.Type.AbstractType.Assemble(Object cached, ISessionImplementor session, Object owner) in AbstractType.cs: line 92
at NHibernate.Type.TypeHelper.Assemble(Object[] row, ICacheAssembler[] types, ISessionImplementor session, Object owner) in TypeHelper.cs: line 67
at NHibernate.Cache.Entry.CacheEntry.Assemble(Object[] values, Object result, Object id, IEntityPersister persister, IInterceptor interceptor, ISessionImplementor session) in CacheEntry.cs: line 79
at NHibernate.Cache.Entry.CacheEntry.Assemble(Object instance, Object id, IEntityPersister persister, IInterceptor interceptor, ISessionImplementor session) in CacheEntry.cs: line 72
at NHibernate.Event.Default.DefaultLoadEventListener.AssembleCacheEntry(CacheEntry entry, Object id, IEntityPersister persister, LoadEvent event) in DefaultLoadEventListener.cs: line 475
at NHibernate.Event.Default.DefaultLoadEventListener.LoadFromSecondLevelCache(LoadEvent event, IEntityPersister persister, LoadType options) in DefaultLoadEventListener.cs: line 448
at NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) in DefaultLoadEventListener.cs: line 314
at NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) in DefaultLoadEventListener.cs: line 110
at NHibernate.Event.Default.DefaultLoadEventListener.ProxyOrLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) in DefaultLoadEventListener.cs: line 166
at NHibernate.Event.Default.DefaultLoadEventListener.OnLoad(LoadEvent event, LoadType loadType) in DefaultLoadEventListener.cs: line 82
at NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType) in SessionImpl.cs: line 2494
at NHibernate.Impl.SessionImpl.Get(String entityName, Object id) in SessionImpl.cs: line 1336
at NHibernate.Impl.SessionImpl.Get(Type entityClass, Object id) in SessionImpl.cs: line 1273
at NHibernate.Impl.SessionImpl.Get(Object id) in SessionImpl.cs: line 1257
at NHibernate.Test.LazyProperty.NH2510Fixture.PropertyLoadedNotInitialized() in NH2510.cs: line 49
> Lazy-loading doesn't work with cache
> ------------------------------------
>
> Key: NH-2510
> URL: http://216.121.112.228/browse/NH-2510
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.GA
> Reporter: Sławomir Rosiek
> Priority: Minor
> Attachments: NH2510-Fixture.patch
>
>
> If I set caching in entity which has lazy property I have the following exception:
> System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.Byte[]'.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-06 22:16:47
|
[ http://216.121.112.228/browse/NH-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21011#action_21011 ]
Fabio Maulo commented on NH-2510:
---------------------------------
Alexey,
are you 100% that the case is the same ?
Sławomir can you check if your case is the same ?
Thanks.
> Lazy-loading doesn't work with cache
> ------------------------------------
>
> Key: NH-2510
> URL: http://216.121.112.228/browse/NH-2510
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.GA
> Reporter: Sławomir Rosiek
> Priority: Minor
> Attachments: NH2510-Fixture.patch
>
>
> If I set caching in entity which has lazy property I have the following exception:
> System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.Byte[]'.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Alexey G. (JIRA) <nh...@gm...> - 2011-05-07 06:07:55
|
[ http://216.121.112.228/browse/NH-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21012#action_21012 ]
Alexey Gorbach commented on NH-2510:
------------------------------------
According to given information - yes. Exception is the same, and it is thrown only when cache is turned on and when entity has lazy-load byte[] field.
Thanks.
P.S. Have you applyied patch ? Is everything OK with it ? Should I change something, if I post another test for another bug ?
> Lazy-loading doesn't work with cache
> ------------------------------------
>
> Key: NH-2510
> URL: http://216.121.112.228/browse/NH-2510
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.GA
> Reporter: Sławomir Rosiek
> Priority: Minor
> Attachments: NH2510-Fixture.patch
>
>
> If I set caching in entity which has lazy property I have the following exception:
> System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.Byte[]'.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Sławomir R. (J. <nh...@gm...> - 2011-05-07 11:12:47
|
[ http://216.121.112.228/browse/NH-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21013#action_21013 ]
Sławomir Rosiek commented on NH-2510:
-------------------------------------
My case is similar. The only difference is that I have cache declaration (with usage equal "read-only") in class mapping.
Thanks.
> Lazy-loading doesn't work with cache
> ------------------------------------
>
> Key: NH-2510
> URL: http://216.121.112.228/browse/NH-2510
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.GA
> Reporter: Sławomir Rosiek
> Priority: Minor
> Attachments: NH2510-Fixture.patch
>
>
> If I set caching in entity which has lazy property I have the following exception:
> System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.Byte[]'.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-07 17:14:50
|
[ http://216.121.112.228/browse/NH-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21015#action_21015 ]
Fabio Maulo commented on NH-2510:
---------------------------------
@Slawomir
same domain same mapping ?
> Lazy-loading doesn't work with cache
> ------------------------------------
>
> Key: NH-2510
> URL: http://216.121.112.228/browse/NH-2510
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.GA
> Reporter: Sławomir Rosiek
> Priority: Minor
> Attachments: NH2510-Fixture.patch
>
>
> If I set caching in entity which has lazy property I have the following exception:
> System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.Byte[]'.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Sławomir R. (J. <nh...@gm...> - 2011-05-07 17:40:48
|
[ http://216.121.112.228/browse/NH-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21016#action_21016 ]
Sławomir Rosiek commented on NH-2510:
-------------------------------------
Domain:
public class GalleryItem
{
public virtual int Id { get; set; }
public virtual string FileName { get; set; }
public virtual byte[] Data { get; set; }
}
XML Mapping:
<class name="GalleryItem">
<cache usage="read-only" />
<id name="Id">
<generator class="native" />
</id>
<property name="FileName" />
<property name="Data" lazy="true" />
</class>
> Lazy-loading doesn't work with cache
> ------------------------------------
>
> Key: NH-2510
> URL: http://216.121.112.228/browse/NH-2510
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.GA
> Reporter: Sławomir Rosiek
> Priority: Minor
> Attachments: NH2510-Fixture.patch
>
>
> If I set caching in entity which has lazy property I have the following exception:
> System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.Byte[]'.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-09 14:14:46
|
[ http://216.121.112.228/browse/NH-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo resolved NH-2510.
-----------------------------
Resolution: Fixed
Fix Version/s: 3.2.0Alpha3
> Lazy-loading doesn't work with cache
> ------------------------------------
>
> Key: NH-2510
> URL: http://216.121.112.228/browse/NH-2510
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.GA
> Reporter: Sławomir Rosiek
> Priority: Minor
> Fix For: 3.2.0Alpha3
>
> Attachments: NH2510-Fixture.patch
>
>
> If I set caching in entity which has lazy property I have the following exception:
> System.InvalidCastException: Unable to cast object of type 'System.Object' to type 'System.Byte[]'.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|