Error: Source array was not long enough. Check srcIndex and length, and the array's lower bounds.

Posts   
 
    
RaFaLe avatar
RaFaLe
User
Posts: 27
Joined: 26-Oct-2006
# Posted on: 09-Nov-2006 08:13:23   

Hi,

I'm using the latest build (Nov 06) of Genpro, v 2.0. I'm using the adapter scenario, also using hierarchies in my objects (one-to-one relationships on some of my objects which is then used for hierarchy when constructing "Target-per-Entity" Hierarchies.

Now when I save the object using the adapter, I get this error: ** Error: Source array was not long enough. Check srcIndex and length, and the array's lower bounds.**

Stack Trace:


   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length)
   at SD.LLBLGen.Pro.ORMSupportClasses.EntityFieldPersistenceInfoList..ctor(IEntityFieldCore[] fields, IFieldPersistenceInfo[] fieldsPersistenceInfo)
   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.SaveEntity(IEntity2 entityToSave, Boolean refetchAfterSave, IPredicateExpression updateRestriction, Boolean recurse)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntity(IEntity2 entityToSave)
   at EnterpriseWorx.SmartClient.LLBLGenPro.DataAccess.DataSaveCommand`1.Save(Boolean fetchAfterSave) in 

Please help - any ideas???

Thanks in advance

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39615
Joined: 17-Aug-2003
# Posted on: 09-Nov-2006 09:27:58   

Please be sure your dbgeneric and dbspecific project are in sync. It sometimes happens developers update the dbgeneric project but not the dbspecific project in their project's runtime folder.

My inheritance unittests all succeed so it's something to do with some code which is out of sync. If you can't find it, please create a testproject and mail it to us at support AT llblgen.com. But I think it's something to do with some files/dlls which aren't updated. Also when you generate code, please be sure you check the generation log for error logs, like when it couldn't overwrite a file.

Frans Bouma | Lead developer LLBLGen Pro
RaFaLe avatar
RaFaLe
User
Posts: 27
Joined: 26-Oct-2006
# Posted on: 09-Nov-2006 09:40:17   

Otis,

You're right - it was the Database Specific stuff that was out of sync (I feel stupid now). Problem solved!

Thanks so much for your help.