You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(110) |
Nov
(296) |
Dec
(107) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(212) |
Feb
(263) |
Mar
(161) |
Apr
(183) |
May
(183) |
Jun
(75) |
Jul
(106) |
Aug
(88) |
Sep
(227) |
Oct
(143) |
Nov
(154) |
Dec
(53) |
| 2008 |
Jan
(77) |
Feb
|
Mar
|
Apr
(6) |
May
(103) |
Jun
(296) |
Jul
(54) |
Aug
|
Sep
(379) |
Oct
(283) |
Nov
(224) |
Dec
(214) |
| 2009 |
Jan
(129) |
Feb
(257) |
Mar
(136) |
Apr
(12) |
May
(329) |
Jun
(434) |
Jul
(375) |
Aug
(171) |
Sep
|
Oct
|
Nov
|
Dec
(54) |
| 2010 |
Jan
(198) |
Feb
(76) |
Mar
(3) |
Apr
(1) |
May
|
Jun
(62) |
Jul
(210) |
Aug
(447) |
Sep
(330) |
Oct
(257) |
Nov
(133) |
Dec
(453) |
| 2011 |
Jan
(240) |
Feb
(128) |
Mar
(442) |
Apr
(320) |
May
(428) |
Jun
(141) |
Jul
(13) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-11 10:59:03
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21048#action_21048 ]
Andrei Alecu commented on NH-2690:
----------------------------------
Oh, sorry for misleading you. I remember now that I made a custom .ToFuture() that casts to QueryableBase<T> instead of NhQueryable<T> and attempted to use that.
Simply try to put this inside some ToFutureExtensions class:
public static IEnumerable<T> ToFuture2<T>(this IQueryable<T> query)
{
var nhQueryable = query as QueryableBase<T>;
if (nhQueryable == null)
throw new NotSupportedException("You can also use the AsFuture() method on NhQueryable");
var future = ((NhQueryProvider)nhQueryable.Provider).ExecuteFuture(nhQueryable.Expression);
return (IEnumerable<T>)future;
}
And then call ToFuture2(). You will then probably see the same error you were originally getting.
I believe that if this particular bug is fixed, then the ToFuture() with Fetch() will work as well.
> Linq Select() broken with .ToFuture()
> -------------------------------------
>
> Key: NH-2690
> URL: http://216.121.112.228/browse/NH-2690
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.1.0
> Reporter: Kelly Stuard
> Priority: Major
> Attachments: NH2690.zip
>
>
> //Given the following:
> var query =
> from cat in session.Query<Cat>()
> select new
> {
> Id = cat.Id,
> Name = cat.Name,
> };
> //This works:
> var result1 = query.ToList();
> //But this does not:
> var queryResults = query.ToFuture().ToList();
> Exception:
> NHibernate.HibernateException was unhandled
> Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_;
> ]
> Source=NHibernate
> StackTrace:
> at NHibernate.Impl.MultiQueryImpl.DoList()
> at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache()
> at NHibernate.Impl.MultiQueryImpl.List()
> at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach)
> at NHibernate.Impl.FutureBatch`2.GetResults()
> at NHibernate.Impl.FutureBatch`2.get_Results()
> at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex)
> at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3()
> at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext()
> at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
> at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
> at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97
> at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16
> at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
> at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
> at System.Threading.ThreadHelper.ThreadStart()
> InnerException: System.ArgumentException
> Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection.
> Parameter name: value
> Source=mscorlib
> ParamName=value
> StackTrace:
> at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType)
> at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item)
> at NHibernate.Impl.MultiQueryImpl.DoList()
> InnerException:
> This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario.
> I will attach test cases used to generate this exception, shortly.
--
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: Denis (JIRA) <nh...@gm...> - 2011-05-11 09:34:00
|
[ http://216.121.112.228/browse/NH-2546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21047#action_21047 ]
Denis commented on NH-2546:
---------------------------
I'm wondering why the issue is not in the 3.1 release and why the priority is 'Minor'?
Does it mean that nobody uses 'Like' criteria?
> MSSQL Like criteria doesn't work if expression length is more then column length
> --------------------------------------------------------------------------------
>
> Key: NH-2546
> URL: http://216.121.112.228/browse/NH-2546
> Project: NHibernate
> Issue Type: Bug
> Components: DataProviders / Dialects
> Affects Versions: 3.0.0.GA
> Reporter: Denis
> Priority: Minor
> Attachments: NH-2546.patch
>
>
> Consider the following situation:
> mapping file contains the following property
> <property name="PostalCode" column="postal_code" type="String(10)"
> not-null="true"/>
> When I apply the following restriction
> Restrictions.Like("PostalCode", "%9108[ -]MC%")
> it doesn't work as expected.
> Generated query looks like this:
> SELECT count(*) as y0_ FROM PostalCodes this_ WHERE this_.postal_code like @p0;@p0 = '%9108[ -]MC%' [Type: String (10)]
> Parameter value length ('%9108[ -]MC%') is 12 symbols and it is correct expression but the value is cutted to '%9108[ -]M' which is not correct.
--
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: Jenar (JIRA) <nh...@gm...> - 2011-05-11 05:41:02
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21046#action_21046 ]
Jenar commented on NH-2697:
---------------------------
Thank you for quick fix for this issue.
> Named parameter not found in HQL with mapping using "entity-name"
> -----------------------------------------------------------------
>
> Key: NH-2697
> URL: http://216.121.112.228/browse/NH-2697
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Jenar
> Priority: Minor
> Fix For: 3.2.0Beta1
>
> Attachments: NHibernate.Test NH-2697.zip
>
>
> string HQL = "update Article a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID";
> IQuery iquery = _session.CreateQuery(HQL);
> iquery.SetInt32("ID", articleGrp.Articlegroupid);
> Throws exception "System.ArgumentException: Parameter ID does not exist as a named parameter in [update Article a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID]"
> if we use different mapping (through entity-name="..")for the same class ("ArticleItem")
> <class name="ArticleItem" ... entity-name="Article" polymorphism="explicit">
> <class name="ArticleItem" ... entity-name="Article2" polymorphism="explicit">
> The same code was working without problems as we had only one mapping for "ArticleItem":
> <class name="ArticleItem" ... polymorphism="explicit">
> string HQL = "update ArticleItem a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID";
> IQuery iquery = _session.CreateQuery(HQL);
> iquery.SetInt32("ID", articleGrp.Articlegroupid);
--
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-10 23:08:18
|
[ http://216.121.112.228/browse/NH-1001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21045#action_21045 ]
Fabio Maulo commented on NH-1001:
---------------------------------
Yes Tomer....
The solution is clean the DB from invalid relations.
> Select statement issued for each not-found=ignore
> -------------------------------------------------
>
> Key: NH-1001
> URL: http://216.121.112.228/browse/NH-1001
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.2.0.GA
> Reporter: Tomer Avissar
> Priority: Minor
> Attachments: HRNHibernateTest.zip
>
>
> When using the not-found=ignore attribute in a one-to-many/many-to-many, NHibernate is issuing a query for every element not found in the collection, even when using an outer join.
> In some cases this causes a significant performance overhead.
--
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: Aren B. (JIRA) <nh...@gm...> - 2011-05-10 22:22:04
|
[ http://216.121.112.228/browse/NH-1681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21044#action_21044 ]
Aren Blondahl commented on NH-1681:
-----------------------------------
I agree, this looks like a feature I'd like to see in trunk very much.
> Update Join element to support keys with property-refs
> ------------------------------------------------------
>
> Key: NH-1681
> URL: http://216.121.112.228/browse/NH-1681
> Project: NHibernate
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.1.0.Alpha1
> Reporter: Daniel Guenter
> Priority: Minor
> Attachments: NH3.0.0.GA ref join.patch, NHibernateJoinPatch.patch
>
>
> <join> element has typically only supported joining to PK of owning table. Sometimes this is limiting especially in dealing with legacy databases where multiple unique keys may be present. It would be nice to be able to specify a property-ref in the <key> element.
> Patch included updates functionality to add the aforementioned improvement. The only caveat is that the column mapped as the property-ref must be marked as unique as well. This patch is kind of invasive as it has to change major functionality to allow specifying of alternate ID's on save/update/delete and in the join query. This patch also supports proper exporting of the schema.
--
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-10 19:22:56
|
[ http://216.121.112.228/browse/NH-2698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21043#action_21043 ]
Fabio Maulo commented on NH-2698:
---------------------------------
NH-2622 is completely different, btw your tests does not fail, that is all.
> Proxying fails for methods with generic type constraints
> --------------------------------------------------------
>
> Key: NH-2698
> URL: http://216.121.112.228/browse/NH-2698
> Project: NHibernate
> Issue Type: Bug
> Components: ByteCode providers
> Affects Versions: 3.2.0Alpha3
> Reporter: cremor
> Attachments: NH2698 Test.zip
>
>
> I just tried to implement the As<T>() method described in this blog post:
> http://sessionfactory.blogspot.com/2010/08/hacking-lazy-loaded-inheritance.html
> But it seems like the dynamic proxy factory has problems creating proxies for methods with generic type constraints. Generic methods without constraints work perfectly, but I need a constraint in that method for the "as" operator.
--
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: cremor (JIRA) <nh...@gm...> - 2011-05-10 18:42:56
|
[ http://216.121.112.228/browse/NH-2698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21042#action_21042 ]
cremor commented on NH-2698:
----------------------------
Err, what? I downloaded Alpha3 today and implemented the test completely new. And it does fail for me. I just changed the default hibernate.cfg.xml to use SQLite and added the test files. The exception was something like "ValidationException: The type argument 'T0' violates the constraint on type parameter 'TRequestedType'" (I can post the exact exception tomorrow when I'm back at work).
And about the priority: I used the same as NH-2622, an issue reported by an NHibernate developer that decribes a very similar bug. So I thought the priority must be right.
> Proxying fails for methods with generic type constraints
> --------------------------------------------------------
>
> Key: NH-2698
> URL: http://216.121.112.228/browse/NH-2698
> Project: NHibernate
> Issue Type: Bug
> Components: ByteCode providers
> Affects Versions: 3.2.0Alpha3
> Reporter: cremor
> Attachments: NH2698 Test.zip
>
>
> I just tried to implement the As<T>() method described in this blog post:
> http://sessionfactory.blogspot.com/2010/08/hacking-lazy-loaded-inheritance.html
> But it seems like the dynamic proxy factory has problems creating proxies for methods with generic type constraints. Generic methods without constraints work perfectly, but I need a constraint in that method for the "as" operator.
--
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: Vasile B. (JIRA) <nh...@gm...> - 2011-05-10 18:33:57
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21041#action_21041 ]
Vasile Bujac commented on NH-2690:
----------------------------------
The combination of .ToFuture() and .Fetch(p => p.Related) doesn't work because the .Fetch() returns a NhFetchRequest<T> (derived from QuerableBase<T>) and .ToFuture() expects a NhQueryable<T> (also derived from QueryableBase<T>) - a cast is performed when calling .ToFuture(). This is a distinct problem, I think there is a related issue NH-2422 (http://216.121.112.228/browse/NH-2422).
I've also run into the "projection and .ToFuture() problem", it is definetely a show stopper. Also I've experienced a similar bug when using .ToFuture() and another type of projection using AliasToBeanTransformer of predefined classes on hql query api (i think it says it was resolved, but nevertheless I've run into this problem with NH 3.1)
> Linq Select() broken with .ToFuture()
> -------------------------------------
>
> Key: NH-2690
> URL: http://216.121.112.228/browse/NH-2690
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.1.0
> Reporter: Kelly Stuard
> Priority: Major
> Attachments: NH2690.zip
>
>
> //Given the following:
> var query =
> from cat in session.Query<Cat>()
> select new
> {
> Id = cat.Id,
> Name = cat.Name,
> };
> //This works:
> var result1 = query.ToList();
> //But this does not:
> var queryResults = query.ToFuture().ToList();
> Exception:
> NHibernate.HibernateException was unhandled
> Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_;
> ]
> Source=NHibernate
> StackTrace:
> at NHibernate.Impl.MultiQueryImpl.DoList()
> at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache()
> at NHibernate.Impl.MultiQueryImpl.List()
> at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach)
> at NHibernate.Impl.FutureBatch`2.GetResults()
> at NHibernate.Impl.FutureBatch`2.get_Results()
> at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex)
> at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3()
> at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext()
> at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
> at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
> at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97
> at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16
> at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
> at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
> at System.Threading.ThreadHelper.ThreadStart()
> InnerException: System.ArgumentException
> Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection.
> Parameter name: value
> Source=mscorlib
> ParamName=value
> StackTrace:
> at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType)
> at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item)
> at NHibernate.Impl.MultiQueryImpl.DoList()
> InnerException:
> This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario.
> I will attach test cases used to generate this exception, shortly.
--
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: Kelly S. (JIRA) <nh...@gm...> - 2011-05-10 18:32:12
|
[ http://216.121.112.228/browse/NH-2422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21040#action_21040 ]
Kelly Stuard commented on NH-2422:
----------------------------------
I am also having this issue in [3.1.0.4000] and will be happy to produce a test for this, if needed/desired.
> ToFuture throws NotSupportedException on IQueryable if Fetch is used.
> ---------------------------------------------------------------------
>
> Key: NH-2422
> URL: http://216.121.112.228/browse/NH-2422
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.0.0.CR1
> Reporter: Michael Hart
> Priority: Major
>
> If a Fetch call is added to an NHibernate LINQ query, a NotSupportedException is thrown as the type is no longer an NhQueryable but rather an NhFetchRequest - however, both types extend QueryableBase.
> ie, this works:
> var result = ses.Query<Child>()
> .ToFuture();
> But this throws a NotSupportedException:
> var result = ses.Query<Child>()
> .Fetch(x => x.Parent)
> .ToFuture();
> This makes the ToFuture and ToFutureValue methods of limited use in a production system where eager fetching is necessary.
> It also reduces the flexibility to modify queries from being lazy loading (or whatever the default is), to adding eager loading later. If an application has been written using futures and lazy loading, then it is non-trivial to add eager fetching as any futures semantics and logic must also be rewritten.
> I believe ToFuture should be modified to test and cast the query as a QueryableBase instead of an NhQueryable.
--
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-10 18:31:51
|
[ http://216.121.112.228/browse/NH-2527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo updated NH-2527:
----------------------------
Priority: Minor (was: Critical)
> AbstractBatcher reuses disposed IDbCommands which causes an ArgumentOutOfRangeException with OracleDataClientDriver
> -------------------------------------------------------------------------------------------------------------------
>
> Key: NH-2527
> URL: http://216.121.112.228/browse/NH-2527
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.0.0.GA
> Reporter: cremor
> Priority: Minor
> Attachments: NH2527 Additional Test.zip, NH2527 Test.zip
>
>
> The attached test shows that the AbstractBatcher reuses already disposed IDbCommands in some cases (in my case, when an OneToMany entry is inserted and updated in the same commit). This seems to be no problem with some (most?) drivers (I tested SQLite20Driver and OracleClientDriver, both had no problems) but causes an ArgumentOutOfRangeException with the OracleDataClientDriver because the Parameters collection is empty.
> The dispose is called from AbstractBatcher.CloseCommand() which is called from OneToManyPersister.DoUpdateRows().
> AbstractBatcher.CloseCommand() checks if 'lastQuery' is the just disposed command and if yes clears it, but doesn't check 'batchCommand'. (Possible fix by calling InvalidateBatchCommand() if batchCommand == cmd.)
> Seems like a similar problem was already fixed for Firebird because the method AbstractBatcher.PrepareBatchCommand() checks for an empty CommandText and the comment says that it's unknown why it's empty sometimes. (Other possible fix by comparing batchCommand.Parameters.Count and parameterTypes.Length.)
> I don't know which of the two fixes would be better (or if there is an even better fix), therefore I didn't create a patch.
> Please note that even with one of the two fixes, the test still fails (with an StaleStateException) if you don't set adonet.batch_size to 0. I don't know why it doesn't work with batching, but this seems like a different bug.
--
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: Kelly S. (JIRA) <nh...@gm...> - 2011-05-10 18:29:55
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21039#action_21039 ]
Kelly Stuard commented on NH-2690:
----------------------------------
Ahh. I ran what you are talking about and got this:
System.NotSupportedException was unhandled by user code
Message=You can also use the AsFuture() method on NhQueryable
I believe that is this issue, exactly: http://216.121.112.228/browse/NH-2422
If anyone who knows what they are doing reads this, I'm now watching HN-2242 and will be happy to produce a test for this, if needed/desired.
> Linq Select() broken with .ToFuture()
> -------------------------------------
>
> Key: NH-2690
> URL: http://216.121.112.228/browse/NH-2690
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.1.0
> Reporter: Kelly Stuard
> Priority: Major
> Attachments: NH2690.zip
>
>
> //Given the following:
> var query =
> from cat in session.Query<Cat>()
> select new
> {
> Id = cat.Id,
> Name = cat.Name,
> };
> //This works:
> var result1 = query.ToList();
> //But this does not:
> var queryResults = query.ToFuture().ToList();
> Exception:
> NHibernate.HibernateException was unhandled
> Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_;
> ]
> Source=NHibernate
> StackTrace:
> at NHibernate.Impl.MultiQueryImpl.DoList()
> at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache()
> at NHibernate.Impl.MultiQueryImpl.List()
> at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach)
> at NHibernate.Impl.FutureBatch`2.GetResults()
> at NHibernate.Impl.FutureBatch`2.get_Results()
> at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex)
> at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3()
> at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext()
> at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
> at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
> at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97
> at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16
> at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
> at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
> at System.Threading.ThreadHelper.ThreadStart()
> InnerException: System.ArgumentException
> Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection.
> Parameter name: value
> Source=mscorlib
> ParamName=value
> StackTrace:
> at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType)
> at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item)
> at NHibernate.Impl.MultiQueryImpl.DoList()
> InnerException:
> This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario.
> I will attach test cases used to generate this exception, shortly.
--
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-10 18:21:52
|
[ http://216.121.112.228/browse/NH-2698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo closed NH-2698.
---------------------------
Resolution: Not an Issue
The user have reported the issue in 3.2.0Alpha3 but his test does not fail.
> Proxying fails for methods with generic type constraints
> --------------------------------------------------------
>
> Key: NH-2698
> URL: http://216.121.112.228/browse/NH-2698
> Project: NHibernate
> Issue Type: Bug
> Components: ByteCode providers
> Affects Versions: 3.2.0Alpha3
> Reporter: cremor
> Attachments: NH2698 Test.zip
>
>
> I just tried to implement the As<T>() method described in this blog post:
> http://sessionfactory.blogspot.com/2010/08/hacking-lazy-loaded-inheritance.html
> But it seems like the dynamic proxy factory has problems creating proxies for methods with generic type constraints. Generic methods without constraints work perfectly, but I need a constraint in that method for the "as" operator.
--
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-10 17:59:50
|
[ http://216.121.112.228/browse/NH-2698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo updated NH-2698:
----------------------------
Priority: Trivial (was: Critical)
> Proxying fails for methods with generic type constraints
> --------------------------------------------------------
>
> Key: NH-2698
> URL: http://216.121.112.228/browse/NH-2698
> Project: NHibernate
> Issue Type: Bug
> Components: ByteCode providers
> Affects Versions: 3.2.0Alpha3
> Reporter: cremor
> Attachments: NH2698 Test.zip
>
>
> I just tried to implement the As<T>() method described in this blog post:
> http://sessionfactory.blogspot.com/2010/08/hacking-lazy-loaded-inheritance.html
> But it seems like the dynamic proxy factory has problems creating proxies for methods with generic type constraints. Generic methods without constraints work perfectly, but I need a constraint in that method for the "as" operator.
--
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: David A. (JIRA) <nh...@gm...> - 2011-05-10 17:44:01
|
[ http://216.121.112.228/browse/NH-1681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21037#action_21037 ]
David Alpert commented on NH-1681:
----------------------------------
This issue just bit our project. We have exactly this scenario and can work around it by writing a View. It would be super nice to roll this functionality into the trunk!
> Update Join element to support keys with property-refs
> ------------------------------------------------------
>
> Key: NH-1681
> URL: http://216.121.112.228/browse/NH-1681
> Project: NHibernate
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.1.0.Alpha1
> Reporter: Daniel Guenter
> Priority: Minor
> Attachments: NH3.0.0.GA ref join.patch, NHibernateJoinPatch.patch
>
>
> <join> element has typically only supported joining to PK of owning table. Sometimes this is limiting especially in dealing with legacy databases where multiple unique keys may be present. It would be nice to be able to specify a property-ref in the <key> element.
> Patch included updates functionality to add the aforementioned improvement. The only caveat is that the column mapped as the property-ref must be marked as unique as well. This patch is kind of invasive as it has to change major functionality to allow specifying of alternate ID's on save/update/delete and in the join query. This patch also supports proper exporting of the schema.
--
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: Andrei A. (JIRA) <nh...@gm...> - 2011-05-10 17:35:58
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21036#action_21036 ]
Andrei Alecu commented on NH-2690:
----------------------------------
I haven't tried your unit test yet, but if you had a property in Cat that associates a different table, then you could try seeing if:
var query =
(from cat in session.Query<Cat>()
select cat).Fetch(p=>p.Property);
works.
I haven't had time to exactly pin point where the problem is, but I believe it is related to Fetch (or) FetchMany. We have reverted our code to not use ToFuture() for now. But I will get back to this soon.
> Linq Select() broken with .ToFuture()
> -------------------------------------
>
> Key: NH-2690
> URL: http://216.121.112.228/browse/NH-2690
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.1.0
> Reporter: Kelly Stuard
> Priority: Major
> Attachments: NH2690.zip
>
>
> //Given the following:
> var query =
> from cat in session.Query<Cat>()
> select new
> {
> Id = cat.Id,
> Name = cat.Name,
> };
> //This works:
> var result1 = query.ToList();
> //But this does not:
> var queryResults = query.ToFuture().ToList();
> Exception:
> NHibernate.HibernateException was unhandled
> Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_;
> ]
> Source=NHibernate
> StackTrace:
> at NHibernate.Impl.MultiQueryImpl.DoList()
> at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache()
> at NHibernate.Impl.MultiQueryImpl.List()
> at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach)
> at NHibernate.Impl.FutureBatch`2.GetResults()
> at NHibernate.Impl.FutureBatch`2.get_Results()
> at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex)
> at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3()
> at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext()
> at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
> at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
> at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97
> at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16
> at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
> at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
> at System.Threading.ThreadHelper.ThreadStart()
> InnerException: System.ArgumentException
> Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection.
> Parameter name: value
> Source=mscorlib
> ParamName=value
> StackTrace:
> at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType)
> at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item)
> at NHibernate.Impl.MultiQueryImpl.DoList()
> InnerException:
> This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario.
> I will attach test cases used to generate this exception, shortly.
--
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: Kelly S. (JIRA) <nh...@gm...> - 2011-05-10 17:31:57
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21035#action_21035 ]
Kelly Stuard commented on NH-2690:
----------------------------------
Andrei,
As I mentioned above, I'm able to do the following, with no error:
var query =
from cat in session.Query<Cat>()
select cat;
var queryResults = query.ToFuture().ToList();
If you are having trouble without anonymous projection, please paste in your complete LINQ statement(s); and, if it's the same base issue, I'll be happy to produce a failing unit test [to add to the one I've already uploaded].
> Linq Select() broken with .ToFuture()
> -------------------------------------
>
> Key: NH-2690
> URL: http://216.121.112.228/browse/NH-2690
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.1.0
> Reporter: Kelly Stuard
> Priority: Major
> Attachments: NH2690.zip
>
>
> //Given the following:
> var query =
> from cat in session.Query<Cat>()
> select new
> {
> Id = cat.Id,
> Name = cat.Name,
> };
> //This works:
> var result1 = query.ToList();
> //But this does not:
> var queryResults = query.ToFuture().ToList();
> Exception:
> NHibernate.HibernateException was unhandled
> Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_;
> ]
> Source=NHibernate
> StackTrace:
> at NHibernate.Impl.MultiQueryImpl.DoList()
> at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache()
> at NHibernate.Impl.MultiQueryImpl.List()
> at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach)
> at NHibernate.Impl.FutureBatch`2.GetResults()
> at NHibernate.Impl.FutureBatch`2.get_Results()
> at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex)
> at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3()
> at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext()
> at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
> at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
> at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97
> at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16
> at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
> at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
> at System.Threading.ThreadHelper.ThreadStart()
> InnerException: System.ArgumentException
> Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection.
> Parameter name: value
> Source=mscorlib
> ParamName=value
> StackTrace:
> at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType)
> at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item)
> at NHibernate.Impl.MultiQueryImpl.DoList()
> InnerException:
> This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario.
> I will attach test cases used to generate this exception, shortly.
--
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-10 16:58:50
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo resolved NH-2697.
-----------------------------
Resolution: Fixed
Fix Version/s: 3.2.0Beta1
Fixed both bugs reported
> Named parameter not found in HQL with mapping using "entity-name"
> -----------------------------------------------------------------
>
> Key: NH-2697
> URL: http://216.121.112.228/browse/NH-2697
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Jenar
> Priority: Minor
> Fix For: 3.2.0Beta1
>
> Attachments: NHibernate.Test NH-2697.zip
>
>
> string HQL = "update Article a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID";
> IQuery iquery = _session.CreateQuery(HQL);
> iquery.SetInt32("ID", articleGrp.Articlegroupid);
> Throws exception "System.ArgumentException: Parameter ID does not exist as a named parameter in [update Article a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID]"
> if we use different mapping (through entity-name="..")for the same class ("ArticleItem")
> <class name="ArticleItem" ... entity-name="Article" polymorphism="explicit">
> <class name="ArticleItem" ... entity-name="Article2" polymorphism="explicit">
> The same code was working without problems as we had only one mapping for "ArticleItem":
> <class name="ArticleItem" ... polymorphism="explicit">
> string HQL = "update ArticleItem a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID";
> IQuery iquery = _session.CreateQuery(HQL);
> iquery.SetInt32("ID", articleGrp.Articlegroupid);
--
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: Andrei A. (JIRA) <nh...@gm...> - 2011-05-10 14:57:59
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21033#action_21033 ]
Andrei Alecu commented on NH-2690:
----------------------------------
Same error seems to happen with ToFuture() and .Fetch/.FetchMany even if the type being selected is the same as the underlaying entity (and not anonymous).
Definitely a show stopper.
> Linq Select() broken with .ToFuture()
> -------------------------------------
>
> Key: NH-2690
> URL: http://216.121.112.228/browse/NH-2690
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.1.0
> Reporter: Kelly Stuard
> Priority: Major
> Attachments: NH2690.zip
>
>
> //Given the following:
> var query =
> from cat in session.Query<Cat>()
> select new
> {
> Id = cat.Id,
> Name = cat.Name,
> };
> //This works:
> var result1 = query.ToList();
> //But this does not:
> var queryResults = query.ToFuture().ToList();
> Exception:
> NHibernate.HibernateException was unhandled
> Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_;
> ]
> Source=NHibernate
> StackTrace:
> at NHibernate.Impl.MultiQueryImpl.DoList()
> at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache()
> at NHibernate.Impl.MultiQueryImpl.List()
> at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach)
> at NHibernate.Impl.FutureBatch`2.GetResults()
> at NHibernate.Impl.FutureBatch`2.get_Results()
> at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex)
> at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3()
> at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext()
> at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
> at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
> at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97
> at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16
> at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
> at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
> at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
> at System.Threading.ThreadHelper.ThreadStart()
> InnerException: System.ArgumentException
> Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection.
> Parameter name: value
> Source=mscorlib
> ParamName=value
> StackTrace:
> at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType)
> at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item)
> at NHibernate.Impl.MultiQueryImpl.DoList()
> InnerException:
> This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario.
> I will attach test cases used to generate this exception, shortly.
--
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: cremor (JIRA) <nh...@gm...> - 2011-05-10 13:46:49
|
[ http://216.121.112.228/browse/NH-2698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
cremor updated NH-2698:
-----------------------
Attachment: NH2698 Test.zip
> Proxying fails for methods with generic type constraints
> --------------------------------------------------------
>
> Key: NH-2698
> URL: http://216.121.112.228/browse/NH-2698
> Project: NHibernate
> Issue Type: Bug
> Components: ByteCode providers
> Affects Versions: 3.2.0Alpha3
> Reporter: cremor
> Priority: Critical
> Attachments: NH2698 Test.zip
>
>
> I just tried to implement the As<T>() method described in this blog post:
> http://sessionfactory.blogspot.com/2010/08/hacking-lazy-loaded-inheritance.html
> But it seems like the dynamic proxy factory has problems creating proxies for methods with generic type constraints. Generic methods without constraints work perfectly, but I need a constraint in that method for the "as" operator.
--
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: cremor (JIRA) <nh...@gm...> - 2011-05-10 13:44:49
|
Proxying fails for methods with generic type constraints
--------------------------------------------------------
Key: NH-2698
URL: http://216.121.112.228/browse/NH-2698
Project: NHibernate
Issue Type: Bug
Components: ByteCode providers
Affects Versions: 3.2.0Alpha3
Reporter: cremor
Priority: Critical
I just tried to implement the As<T>() method described in this blog post:
http://sessionfactory.blogspot.com/2010/08/hacking-lazy-loaded-inheritance.html
But it seems like the dynamic proxy factory has problems creating proxies for methods with generic type constraints. Generic methods without constraints work perfectly, but I need a constraint in that method for the "as" operator.
--
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: Cameron H. (JIRA) <nh...@gm...> - 2011-05-10 13:04:55
|
[ http://216.121.112.228/browse/NH-2500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cameron Harris updated NH-2500:
-------------------------------
Attachment: NH2500.zip
Attached a test-case as per welcome message. Does the same as my test program above.
> NH 3.0 Linq provider uses query parameters from first call in subsequent calls.
> -------------------------------------------------------------------------------
>
> Key: NH-2500
> URL: http://216.121.112.228/browse/NH-2500
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.0.0.GA
> Reporter: Andrey Titov
> Assignee: Patrick Earl
> Priority: Critical
> Attachments: NH-2500.patch, NH2500.zip, NHBugRepro.zip, NHTest3.zip
>
>
> NH 3.0 Linq provider uses query parameters from first call in subsequent calls if this parameters are not propagated to SQL.
> //in first session
> this.number = 545;
> var cats = session.Query<Cat>().Select(cat => new CatInfo { Name = cat.Name, SomeNumber = this.number }).ToList();
> // all works perfect: all CatInfos contains 545
> //later in another session
> this.number = 842;
> var cats = session.Query<Cat>().Select(cat => new CatInfo { Name = cat.Name, SomeNumber = this.number }).ToList();
> // magic happens: all CatInfos contains 545 again
> I've debugged NH and found that in second query it gets QueryPlan from cache in NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan() and it contains parameters from first call of query (NHibernate.Linq.NhLinqExpression.ParameterValuesByName) and then fails to replace them in NHibernate.Linq.NhQueryProvider.SetParameters() because they are not actual SQL parameters (query.NamedParameters).
> Sample solution is attached (VS2010, SQL Server Express DB). Put NH and LinFu.DynamicProxy binaries to .Libraries\NHibernate before build.
> I think actual parameters should be cleared from query (set to default(T)) before putting plan in QueryPlanCache to let them be garbage collected and prevent real magic happen in case of similar bugs.
--
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: Cameron H. (JIRA) <nh...@gm...> - 2011-05-10 09:57:51
|
[ http://216.121.112.228/browse/NH-2500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cameron Harris updated NH-2500:
-------------------------------
Attachment: NHBugRepro.zip
I've created an example for what I believe to be this bug (or at least related). It happens in every version of NHibernate I have tested, from NH3.0GA through to NH3.2Alpha3.
The bug occurs if you pass it a projection expression with the same structure twice, where the projection is a method on an object. The second time you call it, it will execute the method on the first object you passed in, which it appears to have cached. This incorrect behaviour appears to persist for the whole lifetime of the session factory, not just the current session or transaction. Hanging onto user objects could be a bit memory wasteful too..
var foos1 = s.Query<Foo>().Select(x => selector1.Map(x));
var foos2 = s.Query<Foo>().Select(x => selector2.Map(x)); // does the same as foos1
var foos3 = s.Query<Foo>().Select(selector2.Map); // works fine
= Expected output =
S1:Test 1; S1:Test 2
S2:Test 1; S2:Test 2
S2:Test 1; S2:Test 2
= Actual output =
S1:Test 1; S1:Test 2
S1:Test 1; S1:Test 2
S2:Test 1; S2:Test 2
> NH 3.0 Linq provider uses query parameters from first call in subsequent calls.
> -------------------------------------------------------------------------------
>
> Key: NH-2500
> URL: http://216.121.112.228/browse/NH-2500
> Project: NHibernate
> Issue Type: Bug
> Components: Linq Provider
> Affects Versions: 3.0.0.GA
> Reporter: Andrey Titov
> Assignee: Patrick Earl
> Priority: Critical
> Attachments: NH-2500.patch, NHBugRepro.zip, NHTest3.zip
>
>
> NH 3.0 Linq provider uses query parameters from first call in subsequent calls if this parameters are not propagated to SQL.
> //in first session
> this.number = 545;
> var cats = session.Query<Cat>().Select(cat => new CatInfo { Name = cat.Name, SomeNumber = this.number }).ToList();
> // all works perfect: all CatInfos contains 545
> //later in another session
> this.number = 842;
> var cats = session.Query<Cat>().Select(cat => new CatInfo { Name = cat.Name, SomeNumber = this.number }).ToList();
> // magic happens: all CatInfos contains 545 again
> I've debugged NH and found that in second query it gets QueryPlan from cache in NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan() and it contains parameters from first call of query (NHibernate.Linq.NhLinqExpression.ParameterValuesByName) and then fails to replace them in NHibernate.Linq.NhQueryProvider.SetParameters() because they are not actual SQL parameters (query.NamedParameters).
> Sample solution is attached (VS2010, SQL Server Express DB). Put NH and LinFu.DynamicProxy binaries to .Libraries\NHibernate before build.
> I think actual parameters should be cleared from query (set to default(T)) before putting plan in QueryPlanCache to let them be garbage collected and prevent real magic happen in case of similar bugs.
--
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: Jenar (JIRA) <nh...@gm...> - 2011-05-10 08:17:51
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jenar updated NH-2697:
----------------------
Attachment: NHibernate.Test NH-2697.zip
I have prepared a Test for it.
Take a look at:
+ Can_SetArticleFavoriteWithHQL_NamedParam() Exception param not found in HQL
+ Can_GetListOfArticles() no objects returned with HQL
in SampleTest.cs
I have attached also nh2697.fdb for testing.
If Test is not perfectly made/configured sorry for that, because i am using other utils and this is my first NUnit test. Hope it will help you.
> Named parameter not found in HQL with mapping using "entity-name"
> -----------------------------------------------------------------
>
> Key: NH-2697
> URL: http://216.121.112.228/browse/NH-2697
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Jenar
> Priority: Minor
> Attachments: NHibernate.Test NH-2697.zip
>
>
> string HQL = "update Article a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID";
> IQuery iquery = _session.CreateQuery(HQL);
> iquery.SetInt32("ID", articleGrp.Articlegroupid);
> Throws exception "System.ArgumentException: Parameter ID does not exist as a named parameter in [update Article a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID]"
> if we use different mapping (through entity-name="..")for the same class ("ArticleItem")
> <class name="ArticleItem" ... entity-name="Article" polymorphism="explicit">
> <class name="ArticleItem" ... entity-name="Article2" polymorphism="explicit">
> The same code was working without problems as we had only one mapping for "ArticleItem":
> <class name="ArticleItem" ... polymorphism="explicit">
> string HQL = "update ArticleItem a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID";
> IQuery iquery = _session.CreateQuery(HQL);
> iquery.SetInt32("ID", articleGrp.Articlegroupid);
--
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: Jenar (JIRA) <nh...@gm...> - 2011-05-10 05:31:59
|
[ http://216.121.112.228/browse/NH-2697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21029#action_21029 ]
Jenar commented on NH-2697:
---------------------------
Ok i will create test and send it to you.
> Named parameter not found in HQL with mapping using "entity-name"
> -----------------------------------------------------------------
>
> Key: NH-2697
> URL: http://216.121.112.228/browse/NH-2697
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.1.0
> Reporter: Jenar
> Priority: Minor
>
> string HQL = "update Article a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID";
> IQuery iquery = _session.CreateQuery(HQL);
> iquery.SetInt32("ID", articleGrp.Articlegroupid);
> Throws exception "System.ArgumentException: Parameter ID does not exist as a named parameter in [update Article a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID]"
> if we use different mapping (through entity-name="..")for the same class ("ArticleItem")
> <class name="ArticleItem" ... entity-name="Article" polymorphism="explicit">
> <class name="ArticleItem" ... entity-name="Article2" polymorphism="explicit">
> The same code was working without problems as we had only one mapping for "ArticleItem":
> <class name="ArticleItem" ... polymorphism="explicit">
> string HQL = "update ArticleItem a set a.IsFavorite = 0 where a.IsFavorite = 1 and a.Articlegroup.Articlegroupid = :ID";
> IQuery iquery = _session.CreateQuery(HQL);
> iquery.SetInt32("ID", articleGrp.Articlegroupid);
--
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 23:01:49
|
[ http://216.121.112.228/browse/NH-1996?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabio Maulo closed NH-1996.
---------------------------
Resolution: Incomplete
> receive exception: Collection was modified; enumeration operation may not execute. at cascaded delete
> -----------------------------------------------------------------------------------------------------
>
> Key: NH-1996
> URL: http://216.121.112.228/browse/NH-1996
> Project: NHibernate
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.1.0.GA
> Reporter: John Smith
>
> An exception "Collection was modified; enumeration operation may not execute." is thrown while performing a cascaded delete. During the delete I removed the corresponding entity from it's collection (from an interceptor)
> It quickly fixed my problem at Cascade.CascadeCollectionElements(...)
> I replaced:
> foreach (object o in action.GetCascadableChildrenIterator(eventSource, collectionType, child))
> CascadeProperty(o, elemType, style, anything, isCascadeDeleteEnabled);
> by:
> ArrayList list = new ArrayList(); //JS
> foreach (object o in action.GetCascadableChildrenIterator(eventSource, collectionType, child))
> list.Add(o);
> foreach (object o in list)
> CascadeProperty(o, elemType, style, anything, isCascadeDeleteEnabled);
--
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
|