DB2 iSeries driver for latest version of LLBLGen v4 or v5

Posts   
 
    
Posts: 35
Joined: 07-Jun-2016
# Posted on: 07-Jun-2016 20:58:54   

Hi all,

A long time ago we ported the DB2 driver for use with DB2 iSeries using LLBLGen v2.6 and am curious if anyone has done any work with a more current version of LLBLGen for this?

If so, would you be willing to share with me, and if not... can I get access to the source for the current DB2 driver so we can once again port over for use with DB2 iSeries?

Thanks in advance, Matt

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 08-Jun-2016 02:27:33   

Unfortunately iSeries is not supported, but it would be great if you can make a shot at it. The DB2 Drivers as well as the rest of the drivers source code is in the Customer's section of the website (you will need to login), MyAccount/Downloads/[Pick the version].

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 08-Jun-2016 10:04:20   

The source isn't open so you need to be a customer of v5 to access the sourcecode. We don't have access to DB2 iSeries, so we can't test an iSeries driver hence we didn't write one. You need v5's designer to test the code anyway.

V3's driver (and thus v4's and v5's) are different from v2's, we refactored a lot of code so a lot is shared now among the drivers. The same goes for the DQE in the runtime, which you have to port too (as well as the templates, but that's minor as the templates for a database for our runtime are minimal these days). Porting the DQE is rather straight forward as well as it's likely you just have to copy some SQL queries and that's it.

If you want to proceed with writing a driver, and need help with it, just ask what goes where and we're happy to help. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Posts: 35
Joined: 07-Jun-2016
# Posted on: 08-Jun-2016 16:06:24   

We either have v5 or will be purchasing it shortly. Any way to get access to the source for DB2 if I download the v5 trial while waiting for my company to approve the purchase of v5?

I'd really like to get started on this as soon as possible.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 08-Jun-2016 16:38:38   

MattSeaboard wrote:

We either have v5 or will be purchasing it shortly. Any way to get access to the source for DB2 if I download the v5 trial while waiting for my company to approve the purchase of v5?

I'd really like to get started on this as soon as possible.

If you have v5 you can download the sourcecode archive from the website under 'my account -> v5.0 downloads -> Extra section'. We only distribute this sourcecode to licensees, so you have to wait till you have access as a licensee, I'm afraid.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 35
Joined: 07-Jun-2016
# Posted on: 20-Jun-2016 21:47:11   

I now have the sourcecode but the drivers projects in the solution are all missing references to the following:

SD.LLBLGen.Pro.Core SD.LLBLGen.Pro.DBDriverCore SD.Tools.Algorithmia

were those supposed to be included or should i get them from somewhere else?

thanks.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 21-Jun-2016 07:52:46   

MattSeaboard wrote:

SD.LLBLGen.Pro.Core SD.LLBLGen.Pro.DBDriverCore SD.Tools.Algorithmia

were those supposed to be included or should i get them from somewhere else?

Those are in the LLBLGen Pro installation folder, usually at C:\Program Files (x86)\Solutions Design\LLBLGen Pro v5.0

David Elizondo | LLBLGen Support Team
Posts: 35
Joined: 07-Jun-2016
# Posted on: 21-Jun-2016 21:07:36   

daelmo wrote:

MattSeaboard wrote:

SD.LLBLGen.Pro.Core SD.LLBLGen.Pro.DBDriverCore SD.Tools.Algorithmia

were those supposed to be included or should i get them from somewhere else?

Those are in the LLBLGen Pro installation folder, usually at C:\Program Files (x86)\Solutions Design\LLBLGen Pro v5.0

Thank you, that gave me the references I needed. Now I'm seeing that there are some post-build events which try to copy files from \bin\debug folders to ..\Designer\Gui\bin\Debug\Drivers folders. these post-build events are erroring "exited with code 1"

What do these post-build events do and how can i fix the error if they are required?

Also, I don't have a "designer\gui" folder anywhere in the downloaded source.

Edit: I was able to get the solution building, but only after manually creating the "LLBLGenPro_v5.0.4_SourceCode\Designer\Gui\bin\Debug\Drivers" folder as well as a folder for each driver within this "Drivers" folder. May want to clean that up if the source that is available for download doesn't include the Designer\Gui source.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 22-Jun-2016 11:36:47   

MattSeaboard wrote:

daelmo wrote:

MattSeaboard wrote:

SD.LLBLGen.Pro.Core SD.LLBLGen.Pro.DBDriverCore SD.Tools.Algorithmia

were those supposed to be included or should i get them from somewhere else?

Those are in the LLBLGen Pro installation folder, usually at C:\Program Files (x86)\Solutions Design\LLBLGen Pro v5.0

Thank you, that gave me the references I needed. Now I'm seeing that there are some post-build events which try to copy files from \bin\debug folders to ..\Designer\Gui\bin\Debug\Drivers folders. these post-build events are erroring "exited with code 1"

The post build events copy the build dlls to our designer bin so we can test them. You can simply remove the postbuild events.

You can simply copy the dll you build to the Drivers<database>\ folder inside the designer installation folder.

What do these post-build events do and how can i fix the error if they are required?

Also, I don't have a "designer\gui" folder anywhere in the downloaded source.

Edit: I was able to get the solution building, but only after manually creating the "LLBLGenPro_v5.0.4_SourceCode\Designer\Gui\bin\Debug\Drivers" folder as well as a folder for each driver within this "Drivers" folder. May want to clean that up if the source that is available for download doesn't include the Designer\Gui source.

We simply export the source for that project, it's a given some small adjustments have to be made (e.g. we also don't include the sign key)

Frans Bouma | Lead developer LLBLGen Pro
ddesmet
User
Posts: 3
Joined: 23-Nov-2016
# Posted on: 23-Nov-2016 16:41:34   

Hello,

We just started trial of the software and found out that there's no support for DB2 iSeries. Wonder if @MattSeaboard is willing to share the driver so we can be able to test the product.

Or perhaps we can help in giving some feedback in order for you to support it? We are evaluating various products atm but I personally I'm more interested in your offering.

Thank you!

Posts: 35
Joined: 07-Jun-2016
# Posted on: 23-Nov-2016 16:52:17   

ddesmet wrote:

Hello,

We just started trial of the software and found out that there's no support for DB2 iSeries. Wonder if @MattSeaboard is willing to share the driver so we can be able to test the product.

Or perhaps we can help in giving some feedback in order for you to support it? We are evaluating various products atm but I personally I'm more interested in your offering.

Thank you!

We did write a driver for DB2 iSeries. Let me check with our developer to see if it's in a state that can be shared with the public. I'll get back to you.

ddesmet
User
Posts: 3
Joined: 23-Nov-2016
# Posted on: 23-Nov-2016 17:01:08   

MattSeaboard wrote:

We did write a driver for DB2 iSeries. Let me check with our developer to see if it's in a state that can be shared with the public. I'll get back to you.

Thanks a lot Matt! That will mean a lot :-)

ddesmet
User
Posts: 3
Joined: 23-Nov-2016
# Posted on: 05-Dec-2016 17:04:23   

Hello Matt,

Did you got any good news from your developer? If is still not ready for public, maybe perhaps we can be of some help to make it happen. We did port a driver for DB2 iSeries for another ORM we use so we can help around if you want.

Posts: 35
Joined: 07-Jun-2016
# Posted on: 05-Dec-2016 17:09:18   

ddesmet wrote:

Hello Matt,

Did you got any good news from your developer? If is still not ready for public, maybe perhaps we can be of some help to make it happen. We did port a driver for DB2 iSeries for another ORM we use so we can help around if you want.

we still have some work to do on it. We have the driver part working, but still need to get EF to work with DB2. This is on our schedule for next month because we need to start consuming data from our AS400 soon.

Posts: 6
Joined: 19-Jul-2016
# Posted on: 04-Jan-2017 23:53:00   

I'm working on the iSeries DB2 driver for Seaboard and have an initial version written. I have copied it to Drivers folder (under LLBL Gen install dir) and it appears in the LLBL Gen UI.

However, when I select the database driver, I get the following error "Unable to find the requested .Net Framework Data Provider. It may not be installed." Could this be a configuration/install issue with the driver? Is there documentation laying out the steps to install a custom driver and DQE?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 05-Jan-2017 10:24:50   

It fails because it can't load the ADO.NET provider's DbProviderFactory. The factory is loaded by the name you return as the factory name in the driver. Is the DbProviderFactory registered in the .net 4.0's machine.config?

Frans Bouma | Lead developer LLBLGen Pro
Posts: 6
Joined: 19-Jul-2016
# Posted on: 06-Jan-2017 00:30:11   

That's it thanks! I had updated the version of IBM client access and the ADO.Net provider name changed slightly in the machine.config. Thanks!

Posts: 6
Joined: 19-Jul-2016
# Posted on: 11-Jan-2017 19:06:22   

We have the iSeries DB2 driver working for LLBL Gen 5 using a DB provider from Ritmo.(http://www.hitsw.com/products_services/ritmo/ritmo_for_i/ritmo_i.html) They also have support for Entity Framework 6 so I'm trying to use the LLBL Gen designer to generate the EF project including the edmx.

The problem is the resulting edmx gets a compile error. (See below) I have compared the generated edmx to a working version using the Ritmo provider. There are a differences, but nothing that appears to be related to this. Also, the base type for the Sql400PrividerServices class is System.Data.Entity.Core.Common.DbProviderServices (so the error makes sense), but I can't determine how it works in the other edmx.

Any thoughts?

ERROR

Cannot load '\Seaborad.Test.Domain\PRKFTP.edmx': Unable to cast object of type 'Sql400.Data.Entity.Sql400ProviderServices' to type 'System.Data.Common.DbProviderServices'.

Attachments
Filename File size Added on Approval
PRKFTP.edmx 21,313 11-Jan-2017 19:06.56 Approved
TPMTESTF.edmx 36,718 11-Jan-2017 19:07.39 Approved
Posts: 6
Joined: 19-Jul-2016
# Posted on: 12-Jan-2017 19:11:45   

I'm working on solution to rename fields automatically for an AS400 table. (All of the fields are our AS400 are 6 character non-descriptive fields). We solved this in the past by adding the desired field name to the description of the field in the driver and then wrote a plug-in to process entities/fields and used the description to rename the field. (and preserving the original mappings)

However, in v5, when I map the description in the driver, I don't see it in the UI and it is always blank from the Plug-in.

How we are mapping the description in the driver:

In the schema retriever method RetrieveTableAndFieldMetadata, we create DBTableField objects and passing the description as the 3rd parameter:

     new DBTableField(row.Value<string>("COLNAME"), typeDefinition, desc)

How we are referencing the description in the plug-in:

In the PlugIn class Execute method, we iterate over entities and then fields, but thefield.Description is always blank. In the previous version, it referenced the customproperties dictionary (which also exists on the DbTableField above), but does not exist on the FieldElement.


  // Rename each field from the description field that is populated by our iSeries driver
  foreach (FieldElement field in entity.Fields)
  {
       if (!field.IsChanged &&
           !String.IsNullOrWhiteSpace(field.Description))
       {
             field.Name = field.Description;
       }
  }

What is the best way to accomplish this? Thanks for your continued help!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 13-Jan-2017 16:35:15   

Couldn't you solve the fieldname rename with the built-in abbreviation support? Custom properties have to be obtained from the relational model data by switching on a setting, 'Retrieve dbcustom properties', which is not set by default. It's under 'database first' in the project settings.

About the compile error, I have no idea, the edmx doesn't contain these types. The edmx loader will instantiate the ado.net provider which has to implement a services class for EF. From the looks of it, the Ritmo provider is for EF5 and not EF6, as the namespace the class they inherit from looks like an EF5 namespace? Also did you specify the right provider with the connection string?

Frans Bouma | Lead developer LLBLGen Pro
Posts: 6
Joined: 19-Jul-2016
# Posted on: 17-Jan-2017 20:17:46   

Turning on the custom db properties solved the issue along with a change in the plug-in. I was referencing field.Description (which is always blank) and changed it to field.OutputSettingValues.CustomProperties["Description"]. Plug-in is now working, thanks!

On the built in abbreviation support, I don't believe that will solve my problem. (but will mention it just in case). Our element names from the AS400 are randomly generated by a tool called SignOn (CASE Tool). So columns come across as "A1BNNB" which we convert to BOHBuyOrderNumber based on the description in the data dictionary. Original goal was to rename them during the metadata retrieval process in the driver, but it doesn't appear you can assign an alternative name at that point. So instead, we put that desc in the custom properies and use the plug-in to perform the rename.

Another question, when syncing the model to a database, can you preserve the identifying fields that are set manually? The schema we're importing doesn't have any keys defined so we are setting these manually. Problem is when we refresh the keys are cleared out.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 18-Jan-2017 10:34:20   

Ah I see, that doesn't work then indeed. Good that the driver now works! simple_smile

About your question. Sure: Project settings, Database first development: Identifying fields follow db primary key constraints. Set that to false.

Look into the settings, there are many of them which might help you out!

Frans Bouma | Lead developer LLBLGen Pro