Migration from LLBlgen 4.0 to LLBlgen 5.2

Posts   
1  /  2
 
    
Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 03-May-2018 08:44:55   

Hi,

Can anyone help me in migration of code from version 4.0 to 5.2.

I have a project which is currently running on 4.0 and as i am new to LLBlgen technology i am not much aware of how to do it.

I have a seperate Database LLBlgen project file which has been used in my main application.

What all changes i have to do? Please help me if there is any step wise guide to perform this migration.

I have already changes all the Dll's (SD.LLBLGen.Pro.ORMSupportClasses) in my project with upgraded one of 5.2 version.

Now i have to make changes in Database LLBlgen file.

Your help will be highly appreciated.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 03-May-2018 09:44:26   

Please post your thread in the right forum, thanks.

See: https://www.llblgen.com/Documentation/5.2/LLBLGen%20Pro%20RTF/migratingcode.htm for what to do. Start with 4.2->5.0 for the breaking changes you might encounter.

Frans Bouma | Lead developer LLBLGen Pro
Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 04-May-2018 12:25:09   

IS there is any tutorial or Videos available which can help me in doing the migration of code successfully from version 4.0 to 5.2

in the above link which u have mentioned its just the differences i can see between 4.0 version 5.2.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 04-May-2018 14:16:25   

1- Open the 4.x version of your llblgenproj file in the 5.2 LLBLGen Designer. 2- Hit F7 to generate the code (preferably in an empty folder, you can do that by pressing "Edit Selected Task" to change the destination folder). 3- Use the generated projects in your solution instead of the older generated ones. 4- Make sure the generated projects and your application (any project in your solution) is referencing the 5.2 version of the LLBLGen Pro runtime libraries (you mentioned you have already done that, but make sure any thing that starts with SD.LLBLGen.Pro...). 5- Build your project, and if you get compilation errors, then it's time to check the link Otis shared for the breaking changes.

Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 07-May-2018 09:36:26   

Hi Waala

That's a great help. But i want to confirm onething, After opening my 4.0 version LLBlgen project file in 5.2 designer. I do receive around 6 warning and 3 info messages like: I am attaching screenshot of info messages along with this email. When i choose 'perform' for these three info messages, it will then result into 15 more errors which were not getting generated earlier.

Doubts: -Do i need to use this option first 'Sync Relational Model Data' before proceeding with anything?

-When do we use Sync Relational Model data option.

My questions can sound silly to you because i am really new to LLBLgen. Your help is much needed. simple_smile

Attachments
Filename File size Added on Approval
LLBLgen Error.jpg 321,352 07-May-2018 09:37.10 Approved
Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 07-May-2018 10:15:03   

In the attached screenshot as you would see walaa i am receiving two perform option in my Third info message. When i choose first perform option it will result into 15 errors. when i choose second go perform option (Reverse Engineer unmapped tables to typed view instances), its not throwing up any error.

Secondly can i proceed with 'Generate Code' option without resolving warning?

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 08-May-2018 03:31:44   

Yes, just proceed and ignore these warning and info messages. These can be looked into later, if you want to modify your project.

Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 09-May-2018 12:45:43   

Hi Walaa,

I am able to successfully implement all of your mentioned steps. I have change the code in my application. Now generated code which is in use is developed by LLBLgen 5.2 designer.

My code is also building up fine. But my multiple unit test cases are getting failed. All unit test cases which are getting failed are throwing up this error:

Result Message: Test method Vestas.NAcelle.VDD.BLL.MSTest.OrderManagerTest.TestValidateAttachNoMoreThanForecasted threw exception: SD.LLBLGen.Pro.ORMSupportClasses.ORMValueTypeMismatchException: The value abtya is of type 'System.String' while the field is of type 'System.Nullable`1[System.DateTime]'

'ABTYA' is my username. As well as i am receiving around 611 messages in visual studio stating:

Message 515 Could not find schema information for the attribute 'name'. C:\Vestas Project\VDD\Branches\UserStory_Branches\CHG0035544\Source\test\Vestas.Nacelle.ComponentDoc.LLBL.MSTest\app_master.config 19 25 Vestas.Nacelle.ComponentDoc.LLBL.MSTest

Message 516 Could not find schema information for the attribute 'tracingEnabled'. C:\Vestas Project\VDD\Branches\UserStory_Branches\CHG0035544\Source\test\Vestas.Nacelle.ComponentDoc.LLBL.MSTest\app_master.config 19 58 Vestas.Nacelle.ComponentDoc.LLBL.MSTest

Can you please help me with it. Your help will be highly appreciated simple_smile

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 09-May-2018 20:43:04   

Which Database are you using? What's the data type of this field in the database? What's the DBType of the same field in the LLBLGen Pro Designer (Entity/Edit)? What's the .NET Type of the same field in the LLBLGen Pro Designer (Entity/Edit)?

Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 10-May-2018 07:41:53   

Hi Walaa,

I have attached screenshot of every information about user table and databases. Please take a look at it and let me know if you would like to know anything else.

Attachments
Filename File size Added on Approval
UserTableInfo.jpg 258,426 10-May-2018 07:42.29 Approved
Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 10-May-2018 11:14:39   

Hi Walaa,

I have found the problem, Problem lies in this piece of code: Public Overridable Property CreatedByUserName As System.String Get Return CType(GetValue(CInt(VuiFieldIndex.CreatedByUserName), True), System.String) End Get Set(value As System.String) SetValue(CInt(VuiFieldIndex.CreatedByUserName), value) End Set End Property

In older version code was written like this: Public Overridable Property CreatedByUserName As System.String Get Return CType(GetValue(CInt(VuiFieldIndex.CreatedByUserName), True), System.String) End Get Set SetValue(CInt(VuiFieldIndex.CreatedByUserName), value) End Set End Property

But i am not able to remove (Value As Syetem.string) from Set command. Not sure why it is happening this way. Can you please tell me any workaround !!

Attachments
Filename File size Added on Approval
LLBLgenVUI.jpg 314,418 10-May-2018 13:22.48 Approved
Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 10-May-2018 20:23:50   

The attached screenshot didn't answer all my questions.

But anyway, it seems to me that this might be due to some old code being used with the new one. I.e. Please make sure your application doesn't reference old generated entities classes nor PersistenceInfo classes.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 11-May-2018 09:50:00   

Abhi070290 wrote:

Hi Walaa,

I have found the problem, Problem lies in this piece of code: Public Overridable Property CreatedByUserName As System.String Get Return CType(GetValue(CInt(VuiFieldIndex.CreatedByUserName), True), System.String) End Get Set(value As System.String) SetValue(CInt(VuiFieldIndex.CreatedByUserName), value) End Set End Property

In older version code was written like this: Public Overridable Property CreatedByUserName As System.String Get Return CType(GetValue(CInt(VuiFieldIndex.CreatedByUserName), True), System.String) End Get Set SetValue(CInt(VuiFieldIndex.CreatedByUserName), value) End Set End Property

But i am not able to remove (Value As Syetem.string) from Set command. Not sure why it is happening this way. Can you please tell me any workaround !!

I have no idea how the (value As System.String) is emitted there after the 'Set' keyword as it's not in the template and hasn't been there as well. (as in: the line hasn't been changed since 2009!)

Please generate the code using the default templates in a new folder and check it. You also use an outdated build, please use the latest v5.2 version your subscription allows.

Your screenshots suggest you use RDP into a terminal server, is that correct? If so, you use the designer and no-one else, or is this a shared install? If the latter, someone else altered the templates?

Frans Bouma | Lead developer LLBLGen Pro
Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 15-May-2018 12:39:39   

Hi Otis,

Can you please tell me where can i find default template for 5.2 version. And can you please also tell me how to generate source code using default template. As i am new to it, i really dont know how to do it.

I just followed steps given by walaa to generate the source code.

Your help is much needed.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 15-May-2018 20:03:43   

The default templates might be altered, or a custom preset with custom templates are being used.

In the Code Generation window, press "edit the selected task". Could you please tell us, what is written in the "Selected Preset" field?

Also it's a better idea if you install the latest release (v.5.4) side by side, which would be also downloaded with the default templates and give it a shot.

Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 16-May-2018 08:25:49   

Hi Walaa

I have attached a screenshot of selected preset field along with this message. Please take a look at it.

Attachments
Filename File size Added on Approval
Template_LLBL.jpg 243,301 16-May-2018 08:26.07 Approved
Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 16-May-2018 08:27:26   

Hi Walaa,

I am also attaching template binding screenshot. Please take a look at it and please tell me if you can have any idea of perfect resolution.

Attachments
Filename File size Added on Approval
Template Binding.jpg 267,149 16-May-2018 08:27.58 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 16-May-2018 08:53:01   

The default templates come with the installer from our website. Your code is generated with templates which apparently are changed.

Please generate the code in an empty folder and attach one of the entity files generated to a post. No screenshots, just the file. Also, like I said: install the latest 5.2.x version you have access to from our website.

Frans Bouma | Lead developer LLBLGen Pro
Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 16-May-2018 09:30:49   

Hi Otis,

Please find attached entity file along with this message.

And i have installed LLBLgen 5.2.0 version. This is a licensed version which i am using currently.

Attachments
Filename File size Added on Approval
SapExportEntity.vb 36,108 16-May-2018 09:31.21 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 16-May-2018 11:24:46   

Looking at the generated code, I see:


        ''' <summary>The VuiCreatedByUserName property of the Entity SapExport<br/><br/></summary>
        ''' <remarks> Mapped on  table field: "SAPExport"."VuiCreatedByUserName"<br/>
        ''' Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 50<br/>
        ''' Table field behavior characteristics (is nullable, is PK, is identity): True, False, False</remarks>
        Public Overridable Property [VuiCreatedByUserName]() As System.String
            Get
                Return CType(GetValue(CInt(SapExportFieldIndex.VuiCreatedByUserName), True), System.String)
            End Get
            Set
                SetValue(CInt(SapExportFieldIndex.VuiCreatedByUserName), value)
            End Set
        End Property

and not the code you said namely "Set(value As System.String)", which was the difference. So really I'm at a loss what you referred to earlier.

Frans Bouma | Lead developer LLBLGen Pro
Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 16-May-2018 19:33:15   

Hi Otis,

you are referring to wrong property.

It's [OrderCreatedByUserName]. And that's the only property in which i am having this problem. Actually this property was not created by LLBLGen 5.2 designer.

I have manually pasted it from my older code as it was missing in newer code generated by designer LLBLgen 5.2

But when i am pasting it manually, its reflecting as: Public Overridable Property OrderCreatedByUserName As System.String Get Return CType(GetValue(CInt(SapExportFieldIndex.OrderCreatedByUserName), True), System.String) End Get Set(value As System.String) SetValue(CInt(SapExportFieldIndex.OrderCreatedByUserName), value) End Set End Property

I cant even delete it.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 17-May-2018 04:07:43   

I'm really confused and lost here.

I can't understand your last statement

I have manually pasted it from my older code as it was missing in newer code generated by designer LLBLgen 5.2

In context with what you have said before:

have found the problem, Problem lies in this piece of code: Public Overridable Property CreatedByUserName As System.String Get Return CType(GetValue(CInt(VuiFieldIndex.CreatedByUserName), True), System.String) End Get Set(value As System.String) SetValue(CInt(VuiFieldIndex.CreatedByUserName), value) End Set End Property

In older version code was written like this: Public Overridable Property CreatedByUserName As System.String Get Return CType(GetValue(CInt(VuiFieldIndex.CreatedByUserName), True), System.String) End Get Set SetValue(CInt(VuiFieldIndex.CreatedByUserName), value) End Set End Property

Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 17-May-2018 10:51:48   

Hi Guys,

Can you please share your skype Id's or any other medium by which we can interact to each other and i can reproduce the errors in from of you.

Explaining issues here is real tough. I hope you will understand. if its not possible then please do let me know about it.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 17-May-2018 11:58:17   

Please describe clearly what the issues are you have, here. I.e. if you have an exception, please post the exception, the stacktrace and the code snippet. NO SCREENSHOTS please, just copy/paste text.

You made things confusing by stating the error came from a piece of code which was changed since v4.2. However we can't reproduce it (and the generated code you attached also doesn't show that) so it's confusing what it is that you copy / pasted, as that code simply doesn't exist in the generated code you attached. simple_smile

It's currently confusing what exactly you ran into. We don't do skype remote calls for support. Don't panic, it's not that hard really, just clearly describe what you run into, exception, stracktrace, and what code you wrote (!) that triggered that. We can then work from there. Just 1 problem at a time, clearly state:

  • what you did (in code, just copy/paste your code snippet, no screenshots!)
  • what you expected would happen
  • what did happen (exception, stacktrace, and if possible query that ran on the db)

There's another thing though: if I ask you a question, like this one:

Your screenshots suggest you use RDP into a terminal server, is that correct? If so, you use the designer and no-one else, or is this a shared install? If the latter, someone else altered the templates?

I'd like to see them answered as well. thanks.

Frans Bouma | Lead developer LLBLGen Pro
Abhi070290
User
Posts: 43
Joined: 25-Apr-2018
# Posted on: 18-May-2018 08:45:29   

Hi Otis,

I am explaning things from start. I have followed the same procedure suggested by Walaa. I have used LLBLgen files of my Database project and then used these LLBLgen Files in New LLBLGen 5.2 designer to generate the source code in a seperate folder.

I didnt correct any info messages and Warning during the time of code generation.

Then i have changed all the DLL's in my project and used newly created source code.

When i starting building up my code it was throwing error related to this entity [Ordercreatedbyusername]. It was missing in entity files as it was not generated by LLBLgen 5.2 Designer. Therefore i copied everything related to this entity from older code to resolve build errors.

Code is now building up fine but my unit test cases are getting failed throwing this exception:

Result Message: Test method Vestas.NAcelle.VDD.BLL.MSTest.ProcessStepManagerBugTest.SupplierAndItemSearchBug threw exception: SD.LLBLGen.Pro.ORMSupportClasses.ORMValueTypeMismatchException: The value abtya is of type 'System.String' while the field is of type 'System.Nullable`1[System.DateTime]'

When i started debugging my code, problem was lying in this piece of code:

Public Shared Function GetCreatedByUserName(ByVal vui As String, daa As DataAccessAdapter) As String
    Dim bucket As New RelationPredicateBucket()
    bucket.PredicateExpression.AddWithAnd(VuiFields.Vui = vui)
    bucket.PredicateExpression.AddWithAnd(VuiFields.DeletedTs = DBNull.Value)
    Dim ec As New EntityCollection(Of VuiEntity)
    daa.FetchEntityCollection(ec, bucket, 1)
    If ec.Any() Then
        Return ec(0).CreatedByUserName
    Else
        Return Nothing
    End If
End Function

Public Overridable Property CreatedByUserName As System.String Get Return CType(GetValue(CInt(VuiFieldIndex.CreatedByUserName), True), System.String) End Get Set SetValue(CInt(VuiFieldIndex.CreatedByUserName), value) End Set End Property

Code is not able to set the value of Createdbyusername i.e "abtya".

And yes we RDP to connect to an on premise server. And i have just installed the LLBLgen version from its website itself and then i used its licence file. Same case is there with my colleagues who are using LLBLgen 5.2 version.

I hope this time i am able to clarify all your doubts. Please do let me know if you need anything else.

1  /  2