Keith Chisarik
|
|
Group: StrataFrame Users
Posts: 939,
Visits: 40K
|
I finally got connected to our AS400 using DB2Connect software from IBM, not sure why I need another product to do this but according to IBM I do, and our IBM guy says that isnt a stranger model for them to have. Oh well, moving on. I am able to use the BO Mapper against my AS400 OS400 DB2 databases,libraries, and tables, map to business objects and use the "read only" type controls like bound textboxes, the SF Maintenance form, ListView, and BrowseDialog, a hug improvement from 2 weeks ago  Now I need to figure out what to set up for updates and CRUD settings, when I try to "save" it blows out saying there is no primekey on the table (which there is). I imaging is is because I have always relied on the DDT to create sprocs for CRUD, and I cant with the DB2 model. So, where do I go from here? Do I need to create sprocs on the 400 for these? Our in-house 400 guy is an RPM programmer and has never used stored procedures. I nudge along the right direction will be much appreciated. Licensing for the DB2Connect product is about $500.00 for a sinlge user, or $2,500.00 for 25 named users, if anyone was curious. Thanks, Keith
Keith Chisarik
|
|
|
Keith Chisarik
|
|
Group: StrataFrame Users
Posts: 939,
Visits: 40K
|
What I would give for "edit your own post" ability, sorry for the above, been a bad day. RPM = RPG
Keith Chisarik
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
What I would give for "edit your own post" ability, sorry for the above, been a bad day. RPM = RPG Hehe, I just figured the guy was really a car mechanic  As for the stored procedures, you don't have to use them. If you want you use them, you'll need to hand code them (good luck), otherwise, the businss object will generate the CRUD statements on its own. So, as for why the BOMapper isn't picking up on the primary key, I don't know. When you view the fields within the BOMapper, do any of the fields show up with the little key icon? If not, you can specify the primary key for the business object by going into the business object's properties within the BOMapper. There is a field for overriding the PK specification. You can't enter the field, but if you hit the browse button, you'll get a dialog that allows you to enter the field(s) that is the primary key. Once you have that set, everything should be good and allow you enter records.
|
|
|
Keith Chisarik
|
|
Group: StrataFrame Users
Posts: 939,
Visits: 40K
|
I have this problem. Any idea where I can set the property IBM refers to as the fix? I think the connection object is encapsulated in your DB2 provider, yes? My customer does not want to turn on journaling. http://www-1.ibm.com/support/docview.wss?uid=swg21206832
Keith Chisarik
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
You can accomplish this by subclassing the Db2DataSourceItem class and overriding the CreateBlankDbConnection() method. This is the current code, so just modify it to turn off journaling on the connection before you return it: Public Overrides Function CreateBlankDbConnection() As System.Data.Common.DbConnection Dim conn As DbConnection = Me._Factory.CreateConnection() conn.ConnectionString = Me.ConnectionString Return conn End Function The _Factory is, of course private, but you can either override the constructor and store it off yourself, or just create a new DB2Connection object, since you know what provider you're using
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
Or, of course, call MyBase.CreateBlankDbConnection() and just modify the property on the return value before you return it
|
|
|
Keith Chisarik
|
|
Group: StrataFrame Users
Posts: 939,
Visits: 40K
|
I feel dumb asking with all the "of course" language, but can you expand upon this, I do not know how to implement your solution. Thanks.
Keith Chisarik
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
Sure thing  '-- Custom data source class Public Class MyDb2DataSourceItem Inherits MicroFour.StrataFrame.Data.Db2.Db2DataSourceItem Public Sub New(ByVal dataSourceKey As String, ByVal connectionString As String) MyBase.New(dataSourceKey, connectionString, _ System.Data.Common.DbProviderFactories.GetFactory("IBM.Data.DB2")) End Sub Public Overrides Function CreateBlankDbConnection() As System.Data.Common.DbConnection Dim conn As System.Data.Common.DbConnection conn = MyBase.CreateBlankDbConnection() DirectCast(conn, IBM.DB2.Data.DB2Connection).NoJournaling = True Return conn End Function End Class
'-- Change the SetDataSources() method in the AppMain.vb to use your new class, not the SF item Public Shared Sub SetDataSources() DataLayer.DataSources.Add(New MyDb2DataSourceItem("", "db2 connection string")) End Sub So, create your own class, and all you have to override is the CreateBlankDbConnection(). So, get the connection and modify that journaling property before you return it.
|
|
|
Keith Chisarik
|
|
Group: StrataFrame Users
Posts: 939,
Visits: 40K
|
'-- Change the SetDataSources() method in the AppMain.vb to use your new class, not the SF item
that is the piece I was missing thanks Ben!!
Keith Chisarik
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
Aha, glad to set you straight
|
|
|