- Home
- LLBLGen Pro
- LLBLGen Pro Runtime Framework
Where can i download older versions of LLBLGen?
Joined: 07-Sep-2006
Hi,
I downloaded the latest build of the v2 LLBLGen last night. When i rebuilt the project i'm working on a number of errors started appearing.
I'm up against a bit of a tight deadline so, rather than exploring the problem right now, is it possible to get hold of the older versions of the LLBLGen product? I couldn't spot anywhere to download it from on my customer area.
The version that we used previously was from around the 26th August 2006 and would have been the full msi install. I can't recall the build number, but the version number for the SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll was 2.0.0.60814
Many thanks Ian
You mean older builds of v2.0 or older versions like 1.0.2005.1 ?
If you mean: older builds of v2.0, which errors did you run into? As they're probably easy to resolve.
All newer builds shouldn't break any code, just fix bugs and issues.
Joined: 07-Sep-2006
Hi Otis,
Older versions of v2.0
It's a couple of issues.
The first is a verbose xml serialization problem across web services. I've been using a slightly unorthodox approach (http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7479) which seems to have stopped working with this latest version.
Essentially, if i try and save a new entity that is part of a inhertiance hierarchy I get a KeyNotFoundException when i call SaveEntityCollection (using the Adapater model).
The process goes like:
-
WinForms client app gets an EntityCollection of a specific sub-type from the hierarchy across the web service
-
Some changes are made / new entities (of the specific sub-type) are added
-
EntityCollection sent back across web service
-
Service tier calls SaveEntityCollection. And at that point it dies.
If i try and look at the debug visualizer for the entitycollection within the service (after it's come back across the web service) i get an 'System.Runtime.Serialization.SerializationException: Member '_isDeleted' was not found' and the visualizer bombs out.
It worked fine on the older libraries - but as the approach i am using is not really supported (slap on the wrist for me!) it's not a great a suprise that it doesn't work now.
The second issue is to do with a fairly complex RelationPredicateBucket that I'm using. It gives me a ORMRelationException with a message of 'Relation at index 3 doesn't contain an entity already added to the FROM clause. Bad alias?'
I saw another post with the same issue from a year or so ago. But didn't spend too much time working through it. (i think it was about the v1 libraries, anyway)
If you need full examples, i can probably send you over a solution file and database extract, but i thought if I at least try against the old libraries first, that will get me back on track for this deadline.
Cheers Ian
iturner wrote:
Hi Otis,
Older versions of v2.0
It's a couple of issues.
The first is a verbose xml serialization problem across web services. I've been using a slightly unorthodox approach (http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7479) which seems to have stopped working with this latest version.
Essentially, if i try and save a new entity that is part of a inhertiance hierarchy I get a KeyNotFoundException when i call SaveEntityCollection (using the Adapater model).
Do you have a stacktrace for me so I can check where it might be caused by?
The process goes like:
WinForms client app gets an EntityCollection of a specific sub-type from the hierarchy across the web service
Some changes are made / new entities (of the specific sub-type) are added
EntityCollection sent back across web service
Service tier calls SaveEntityCollection. And at that point it dies.
If i try and look at the debug visualizer for the entitycollection within the service (after it's come back across the web service) i get an 'System.Runtime.Serialization.SerializationException: Member '_isDeleted' was not found' and the visualizer bombs out.
You might have the older debugger visualizers dll in the vs.net folder in your profile folder, including the older ormsupportclasses dll. Please update these and try again, it then should visualize the data.
It worked fine on the older libraries - but as the approach i am using is not really supported (slap on the wrist for me!) it's not a great a suprise that it doesn't work now.
I'm checking the bugfix logs, but I can't really find an issue which drastically changed the xml serialization, only a bug fix in pk fields being marked as changed in the deserialized entities.
The second issue is to do with a fairly complex RelationPredicateBucket that I'm using. It gives me a ORMRelationException with a message of 'Relation at index 3 doesn't contain an entity already added to the FROM clause. Bad alias?'
I saw another post with the same issue from a year or so ago. But didn't spend too much time working through it. (i think it was about the v1 libraries, anyway)
This is likely caused by the code which adds the relations to the relationcollection, so if you could post the code snippet where you build the relationscollection it would be great . A bugfix was required for hierarchy joins so when relations are converted to a join list, the routine follows a different path now. It might be your code worked with the previous code by accident but fails with the latest build. It's often not hard to determine which relation is wrong.
If you need full examples, i can probably send you over a solution file and database extract, but i thought if I at least try against the old libraries first, that will get me back on track for this deadline. Cheers Ian
I could extract a revision of the ormsupportclasses dll from subversion for you, though its likely you'll end up with another problem which is fixed in the current code. If that's OK for you I'll send you a build of revision 4379, which was the revision after the checkin on August 14th.
Joined: 07-Sep-2006
Hi Otis,
Do you have a stacktrace for me so I can check where it might be caused by?
The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary2.get_Item(TKey key)
at SD.LLBLGen.Pro.ORMSupportClasses.DynamicQueryEngineBase.CreateInsertDQ(IEntityFieldCore[] fields, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.CreateInsertDQ(IEntity2 entityToSave, IFieldPersistenceInfo[] persistenceInfoObjects)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.PersistQueue(List
1 queueToPersist, Boolean insertActions)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntityCollection(IEntityCollection2 collectionToSave, Boolean refetchSavedEntitiesAfterSave, Boolean recurse)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntityCollection(IEntityCollection2 collectionToSave)
at Vendimax.Services.Administration.AdministrationService.SaveAdminData[T](Guid clientId, EntityCollection1 updatedEntities, EntityCollection
1 deletedEntities) in D:\source\Projects\Vendimax\Vendimax V5\Vendimax.Services.Administration\AdministrationService.cs:line 207
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
You might have the older debugger visualizers ...
Well Spotted!
So, the problem may well not be a serialization one, then.
This is likely caused by the code which adds the relations to the relationcollection, so if you could post the code snippet where you build the relationscollection it would be great
// Create the machines
EntityCollection<VendingMachineEntity> machines = new EntityCollection<VendingMachineEntity>(new VendingMachineEntityFactory());
// Create the now constant
DateTime plannedCutOff = DateTime.Now.AddHours(24);
// Create the filter for deslected planned machines
IPredicateExpression deslectedFilter = new PredicateExpression();
deslectedFilter.AddWithAnd(ScheduleFields.InvocationDate <= plannedCutOff);
deslectedFilter.AddWithAnd(VendingMachineFields.DontOperateNextTime == true);
// Create the filter for flagged KPIs
IPredicateExpression kpiFilter = new PredicateExpression();
kpiFilter.AddWithOr(LocationKpiFields.LatestScanStatus < 2);
kpiFilter.AddWithOr(LocationKpiFields.StockLevelStatus < 0.6);
kpiFilter.AddWithOr(LocationKpiFields.StockOutageStatus < 0.8);
kpiFilter.AddWithOr(LocationKpiFields.LocationStockBalance > 1.1);
kpiFilter.AddWithOr(LocationKpiFields.RequiresStockTake == 1);
// Create the not on route filter
IPredicateExpression notOnRouteFilter = new PredicateExpression();
notOnRouteFilter.Add(RouteFields.RouteId == DBNull.Value);
// Create the filter for unplanned machines
IPredicateExpression unplannedFilter = new PredicateExpression();
unplannedFilter.AddWithAnd(ScheduleFields.InvocationDate > plannedCutOff);
// Create the unplanned OR not on route combination
IPredicateExpression unplannedOrNotOnRouteFilter = new PredicateExpression();
unplannedOrNotOnRouteFilter.AddWithOr(unplannedFilter);
unplannedOrNotOnRouteFilter.AddWithOr(notOnRouteFilter);
// Create the flagged kpi and unplanned or not on route filter
IPredicateExpression flaggedMachineFilter = new PredicateExpression();
flaggedMachineFilter.AddWithAnd(kpiFilter);
flaggedMachineFilter.AddWithAnd(unplannedOrNotOnRouteFilter);
flaggedMachineFilter.AddWithAnd(ConnectedVendingMachineEntity.GetEntityTypeFilter());
// Create the deselected or flagged filter
IPredicateExpression deselectedOrFlaggedFilter = new PredicateExpression();
deselectedOrFlaggedFilter.AddWithOr(deslectedFilter);
deselectedOrFlaggedFilter.AddWithOr(flaggedMachineFilter);
// Create the bucket
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.Relations.Add(VendingMachineEntity.Relations.LocationKpiEntityUsingClientIdLocationId);
bucket.Relations.Add(VendingMachineEntity.Relations.RouteEntityUsingClientIdRouteId, JoinHint.Left);
bucket.Relations.Add(RouteEntity.Relations.ScheduleEntityUsingScheduleId, JoinHint.Left);
bucket.PredicateExpression.Add(VendingMachineFields.ClientId == this.clientId);
bucket.PredicateExpression.Add(deselectedOrFlaggedFilter);
// Create the prefetch
IPrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.ConnectedVendingMachineEntity);
IPrefetchPathElement2 clientElement = prefetchPath.Add(ConnectedVendingMachineEntity.PrefetchPathClient);
IPrefetchPathElement2 routeElement = prefetchPath.Add(ConnectedVendingMachineEntity.PrefetchPathRoute);
IPrefetchPathElement2 scheduleElement = routeElement.SubPath.Add(RouteEntity.PrefetchPathSchedule);
IPrefetchPathElement2 kpiElement = prefetchPath.Add(ConnectedVendingMachineEntity.PrefetchPathLocationKpi);
IPrefetchPathElement2 siteElement = prefetchPath.Add(ConnectedVendingMachineEntity.PrefetchPathSite);
// Create the adapter
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchEntityCollection(machines, bucket, prefetchPath);
}
// Return
Console.WriteLine("Found {0} machines", machines.Count);
Entities are:
Client <- Location <- LocationKPI | SitedLocation -> Site | VendingMachine -> Route -> Schedule | ConnectedVendingMachine
I could extract a revision of the ormsupportclasses dll from subversion for you...
Let's see how far we get first, shall we? It may well be that I've overlooked something whilst upgrading to the latest builds. THough I've double-checked as much as I can.
Cheers Ian
Joined: 07-Sep-2006
Hi Otis,
NOTE: I've edited this because my initial test directly against the adapter was not accurate
So, the problem may well not be a serialization one, then
I've just tested this bypassing the web services - i.e. going straight to my services code across remoting and i get the same error.
The service is an implementation of an interface as follows:
public interface IAdministrationService
{
EntityCollection<T> GetAdminData<T>(Guid clientId) where T : EntityBase2;
EntityCollection<T> SaveAdminData<T>(Guid clientId, EntityCollection<T> updatedEntities, EntityCollection<T> deletedEntities) where T : EntityBase2;
}
public class AdminService : IAdministrationService
{
public EntityCollection<T> GetAdminData<T>(Guid clientId) where T : EntityBase2
{
// Big switch to get the EntityFactory from the EntityBase2 type (T) and an appropriate bucket
Type factory = ... result of the switch ...
RelationPredicateBucket bucket = ... result of the switch ...
// Create the entities
EntityCollection<T> entities = new EntityCollection<T>(factory);
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchEntityCollection(entities, bucket);
}
// Return
return entities;
}
public EntityCollection<T> SaveAdminData<T>(Guid clientId, EntityCollection<T> updatedEntities, EntityCollection<T> deletedEntities) where T : EntityBase2
{
// Create a transaction
using (TransactionScope scope = new TransactionScope())
{
// Create the adapter
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
// Do the deletes
adapter.DeleteEntityCollection(deletedEntities);
// Do the updates
adapter.SaveEntityCollection(updatedEntities);
}
// Mark it as complete
scope.Complete();
}
// Get the lot again
return this.GetAdminData<T>(clientId);
}
}
When i get some entities from the admin service, change or add them, then save to the admin service - all across remoting - i get the KeyNotFoundException.
When i do the same thing NOT across remoting, i get:
An exception was caught during the execution of an action query: Cannot insert the value NULL into column 'client_id', table 'Vendimax V5.retail.location'; column does not allow nulls. INSERT fails.
The statement has been terminated.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
at SD.LLBLGen.Pro.ORMSupportClasses.BatchActionQuery.Execute()
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteActionQuery(IActionQuery queryToExecute)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.PersistQueue(List`1 queueToPersist, Boolean insertActions)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntityCollection(IEntityCollection2 collectionToSave, Boolean refetchSavedEntitiesAfterSave, Boolean recurse)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntityCollection(IEntityCollection2 collectionToSave)
at Vendimax.UnitTests.EntityTest.CreateVan() in D:\source\Projects\Vendimax\Vendimax V5\Vendimax.UnitTests\EntityTest.cs:line 70
at Vendimax.UnitTests.EntityTest.RunTest() in D:\source\Projects\Vendimax\Vendimax V5\Vendimax.UnitTests\EntityTest.cs:line 30
at Vendimax.UnitTests.Program.Main(String[] args) in D:\source\Projects\Vendimax\Vendimax V5\Vendimax.UnitTests\Program.cs:line 46
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
So it's actually a problem with the inheritance tree itself - nothing to do with serialization...
Not sure whether that helps at all.
Cheers Ian
Could you check if the generated code assemblies are in sync with the db, thus that you've the latest generated code compiled in your service? (I don't know if you have the latest templates, if not, it's recommended you use the latest templates together with the latest runtimes)
Client_ID is an FK field in location to client?
Also, what's the entity graph containing (which types are in the graph) when you save the entities, the ones you have drawn in your hierarchy ascii drawing?
Joined: 07-Sep-2006
Hi Otis,
My previous message was still not accurate even after the edit (it must have been a long day). I had not set the client_id proprty of the new entity, hence the not null constraint error. So ignore that message.
Anyway, the actual beahviour is that the code doesn't work across remoting (it gives the KeyNotFoundException) but does work when executed directly against the adapter.
In terms of the entities being used, the tree is as follows:
Location SitedLocation : Location Store : SitedLocation VendingMachine : SitedLocation ConnectedVendingMachine : VendingMachine Van : Location RetailVan : Van
The test case i've got just gets all RetailVans, creates a new one, and saves it.
I've seen the same behaviour from all parts of the tree, however.
The other things i have done are:
- Refreshed the schema within the project (nothing had changed in the db, anyway
- Recreated all the code
- Performed a diff between the recreated entities and those in source control from the last (working) set. The only differences were in the GetObjectData serialization methods - which presumably have changed in recent templates (i am using the latest templates)
So, still stumped. I'm going to compile the ORM source and see if i can track down which key it is not finding.
I'll add more to this thread as i discover it.
Cheers Ian
So syncing info isn't propagated across a remoting boundary as it seems. With your tests, that's what you should look into I think: the location entity should have a syncinfo object with the client entity in it. I have unittests which test this so it's strange...
I call it a day as it's late here, please post any info you get uncovered in this thread so I can pick up where you left it tomorrow morning.
Joined: 07-Sep-2006
Hi Otis,
I could extract a revision of the ormsupportclasses dll from subversion for you, though its likely you'll end up with another problem which is fixed in the current code. If that's OK for you I'll send you a build of revision 4379, which was the revision after the checkin on August 14th
Do you think you could do that? Could you also extract the SQLServerDQE libraries as well? Will the latest templates be backwards compatible with the libraries?
Or perhaps even easier to pull the MSI out if it's held in Subversion?
I'm struggling with this problem, and really can't afford to lose any more time on it.
Once the pressure is off, i'll work out what is going wrong with the latest builds.
Cheers Ian
iturner wrote:
Hi Otis,
I could extract a revision of the ormsupportclasses dll from subversion for you, though its likely you'll end up with another problem which is fixed in the current code. If that's OK for you I'll send you a build of revision 4379, which was the revision after the checkin on August 14th
Do you think you could do that? Could you also extract the SQLServerDQE libraries as well? Will the latest templates be backwards compatible with the libraries?
The templates won't be compatible, so I'll send you this: - runtime lib source (it's one solution, so dqe's as well), of the proper revision. - build library - templates of that revision.
Or perhaps even easier to pull the MSI out if it's held in Subversion? I'm struggling with this problem, and really can't afford to lose any more time on it.
Once the pressure is off, i'll work out what is going wrong with the latest builds.
Cheers Ian
No problem. I'll mail you the information in a zip file, to the email address you used to register on this forum. I'll also do some testing myself to see if I can find a bug in current code using hierarchies, serialization and saving of data.
Joined: 07-Sep-2006
Hi Otis,
Thanks for that. Over the next few days (when i have time) I'll package up the relevant bits of the solution that will demonstrate the problem using the current builds.
But at least it will not have to be high priority so no pressure on either side.
As usual, many thanks for such excellent support.
Cheers Ian
Emailed.
One thing to note: it is important you keep client and server on the same version. So if you decide to update the server to the latest llblgen pro build, it's recommended you update the client as well.
Joined: 07-Sep-2006
Hi Otis,
Just received the email, thanks.
One thing to note: it is important you keep client and server on the same version. So if you decide to update the server to the latest llblgen pro build, it's recommended you update the client as well
Yep, we maintain the same versions on server and client. The system is all web-based with a couple of clickonce apps - so that makes keeping it all synch'd nice and easy.
Cheers Ian
Ok, please let me know if there are problems with the code I sent you. Be aware that there have been bugfixes on the code you've received, so let's hope you won't run into the issues before hte deadline's there.
I'll close the thread for now. Please re-open if you've found time to continue with this issue by posting a new message.