Error filling a child business object


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Thanks.  Let me know Smile
PeterA
PeterA
StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)
Group: Forum Members
Posts: 72, Visits: 235
Well, I have a workaround and it involves putting a check I would normally have in there anyway (I'm just in initial stages or writing this program). If I get the chance to write a smaller sample, I'll do that and post it so you all can try and reproduce the same problem.



Thanks!

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
but why is it cutting off the SQL when the parent business object is empty?

I am not sure.  If you are using Enterprise Server then I could potentially see some type of network issue.  But if this is all client side, then I really don't know.  I would have to have some type of reproducable sample.  Like anything else, if we can reproduce it we can fix it Smile

PeterA
PeterA
StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)
Group: Forum Members
Posts: 72, Visits: 235
Ok. Did some more playing around and it seems that it requires that no records come back before it generates this funky SQL that it tries to send off.



I changed my PurchaseOrders to bring back a specified vendor (from the selection menu) and everything for the past 365 days. I then tried to fill PurchaseOrderSchedules by the Parent and, in the event that PurchaseOrders has records, I get correct values. If Purchase Orders is empty, it tries to generate something funny. I'll drop an IsEmpty check in there to block the problem, but why is it cutting off the SQL when the parent business object is empty?
PeterA
PeterA
StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)
Group: Forum Members
Posts: 72, Visits: 235
I'll see what I can do about creating a small sample. Part of the issue is that I think it might just have something to do with the large number of fields on both business objects. Here's the stack trace for this error:



[DB2Exception (0x80004005): ERROR [42601] [IBM][DB2/6000] SQL0104N An unexpected token ")" was found following ""SW_ORDER_SCHED" WHE". Expected tokens may include: "END-OF-STATEMENT". SQLSTATE=42601

]

IBM.Data.DB2.DB2Command.a(CommandBehavior A_0, String A_1, DB2CursorType A_2, Boolean A_3, Boolean A_4, Boolean A_5, Int32 A_6) +3973

IBM.Data.DB2.DB2Command.a(CommandBehavior A_0, String A_1) +47

IBM.Data.DB2.DB2Command.ExecuteReader(CommandBehavior behavior) +93

IBM.Data.DB2.DB2Command.ExecuteDbDataReader(CommandBehavior behavior) +33

System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7

System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141

System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162

System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +107

MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack) +139

MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataTable(QueryInformation QueryInfo, OnChangeEventHandler CallBack) +56

MicroFour.StrataFrame.Data.DataLayer.GetDataTable(QueryInformation QueryInfo, Boolean RegisterNotification) +152

MicroFour.StrataFrame.Business.BusinessLayer.FillOrGetByParentPrimaryKey(Object[] ParentPrimaryKeys, Boolean ReplaceCurrentDataTable) +546

MicroFour.StrataFrame.Business.BusinessLayer.FillOrGetByParent(BusinessLayer Parent, Boolean ReplaceCurrentTable) +470

MicroFour.StrataFrame.Business.BusinessLayer.FillByParent(BusinessLayer Parent) +33

Payless.Sourcing.BPM.PurchaseOrders.Schedule.mnuVendor_SelectedIndexChanged(Object sender, EventArgs e) in I:\PSS Design\Visual Studio\BPM\Business Partner Module\PO\Schedule.aspx.cs:190

System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +105

System.Web.UI.WebControls.DropDownList.RaisePostDataChangedEvent() +134

System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +7

System.Web.UI.Page.RaiseChangedEvents() +117

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1646




I don't know why, but it just suddenly cuts off the SQL its generating (see the PO.html file attached to my original post) -- either that or it generates everything, but doesn't send it. I'm on SF 1.6.1 (with a slew of fixes from some issues I ran into last Fall). I'm using the DB2 9.0.0.2 provider and the database itself is DB2 UDB v8 (hosted on an AIX platform).



I've got a way I can work around the problem, but it means I have to make a DB call each time I navigate to a new record in the Purchase Orders business object. Causes the load time to be quite a bit slower than I'd like. I'm going to try out a couple other options, but the SQL the provider is sending to DB2 doesn't seem to match with what I would think would be generated.



Again, I'll see if I can come up with a simplified sample.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Peter,

As much as I would like to give you an answer here, I am afraid that I do not have near enough information to diagnose the issue here.

We have a number of people using the DB2 provider and this is the first time that I have heard of the SQL being generated incorrectly.  So in this instance, I am going to need to know more details.  If you can produce a small sample for me that reproduces the error then I will gladly debug to see what is going on and if there is an issue get you a fix (or at least an answer).

Also, if you could provide what version of SF you are running, your database version, the provider that you are using (since the DB2 can use any provider), etc.  Thanks.

PeterA
PeterA
StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)
Group: Forum Members
Posts: 72, Visits: 235
I'm working on a new application and I have two business objects: PurchaseOrders and PurchaseOrderSchedules. I want to fill the schedules based on all the POs in the parent object, but only for the selected vendor. So I have a drop down populated with vendors for which the user can view POs and in the SelectedIndexChanged event, I have the following:



DataLayer.DataSources[Global.Config["DataSourceKey"]].SetDebugOn("i:\\PSS Design\\Logs\\PO.html", true);

PurchaseOrders.FillByVendorAndTimePeriod(mnuVendor.SelectedValue, 91);

PurchaseOrderSchedules.FillByParent();

DataLayer.DataSources[Global.Config["DataSourceKey"]].SetDebugOff();





I get an IBM DB2 exception because the SQL being generated for the schedule object isn't correct. Attached is the debug file output. It's the second statement that is all wonky. Any suggestions?



Thanks!

Attachments
PO.zip (115 views, 1.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search