Error Filling Business Objects Using Enterprise Server


Author
Message
Jared Ewald
Jared Ewald
StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)
Group: StrataFrame Users
Posts: 18, Visits: 43
Hello. I am getting an error whenever I try to fill a business object when an EnterpriseDataSourceItem is used as the datasource. The error is reporting that "[t]he specified DataSourceKey was not found within the collection." However, I have verified that the DataSourceKey is correct for the business objects (it's the default empty string) and that the server contains the correct key.



I have declared the datasource like so:



EnterpriseDataSourceItem dss = new EnterpriseDataSourceItem("", "SERVER", 80, "smalldb", new OracleDataSourceItem("")) ;





The stack trace is below. Any ideas?



Thanks,



Jared



EnterpriseDataSourceException

An error occurred while executing the command on the remote data source. See the inner exception for more details.

IndexOutOfRangeException

The specified DataSourceKey was not found within the collection.



Source : MicroFour StrataFrame Enterprise Client



Stack Trace:

at MicroFour.StrataFrame.Data.DataSourceCollection.get_Item(String DataSourceKey)

at MicroFour.StrataFrame.Data.Enterprise.RequestProcessor.ExecuteDataTable(ExecuteDataTableParams params)

at MicroFour.StrataFrame.Data.Enterprise.EnterpriseDataSourceItem.a(DbCommand A_0, Boolean A_1, String A_2)

at MicroFour.StrataFrame.Data.Enterprise.EnterpriseDataSourceItem.GetDataTable(QueryInformation QueryInfo, OnChangeEventHandler CallBack)

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

at MicroFour.StrataFrame.Business.BusinessLayer.FillOrGetByPrimaryKey(Object[] PrimaryKeyValues, Boolean ReplaceCurrentDataTable)

at MicroFour.StrataFrame.Business.BusinessLayer.FillByPrimaryKey(Object PrimaryKeyValue)

at PROGRAM.PANEL.populateInformation() in FILEWITHEXCEPTION:line 172

at PROGRAM.PANEL.performSearch() in FILEWITHEXCEPTION:line 420

at PROGRAM.PANEL.txtbox_KeyDown(Object sender, KeyEventArgs e) in FILEWITHEXCEPTION:line 605

at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)

at System.Windows.Forms.MaskedTextBox.OnKeyDown(KeyEventArgs e)

at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)

at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)

at System.Windows.Forms.MaskedTextBox.ProcessKeyMessage(Message& m)

at System.Windows.Forms.Control.WmKeyChar(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.TextBoxBase.WndProc(Message& m)

at System.Windows.Forms.MaskedTextBox.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)

at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Jared Ewald
Jared Ewald
StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)
Group: StrataFrame Users
Posts: 18, Visits: 43
My problem has now changed regarding the filling of business objects from an enterprise server datasource. It appears that some business objects are not being filled when using the fillByPrimaryKey method. However, these objects do fill when swapping the datasource with a direct Oracle dataSourceItem. Any ideas what may be causing this?



Thanks,



Jared
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
The problem is that the data source key that you are specifying is not setup on the Enterprise Server side.  You defined the ES data source that will be used by your application.  The the OracleDataSOurceItem that you are planning on using must be setup on the ES side so the EnterpriseDataSourceItem knows how to communicate once it reaches the ES server.

First, open the status page of your ES Server.  Go to the Data Sources connection.  Do you have the OracleDataSOurceItem setup here?  You can get to the status page through the shortcut created by the install or by just navigating to the root of your ES server.  You can learn more about this in the ES help documentation as well.


Jared Ewald
Jared Ewald
StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)
Group: StrataFrame Users
Posts: 18, Visits: 43
I did have the Oracle dataSource set up on the server side. It seems to work now, as I no longer get the error I had above. It now appears that some business objects are not being filled when using the fillByPrimaryKey method. However, these objects do fill when swapping the datasource with a direct Oracle dataSourceItem. Any ideas what may be causing this?



Thanks,



Jared
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Jared,

It seems to work now, as I no longer get the error I had above. It now appears that some business objects are not being filled when using the fillByPrimaryKey method.

This is probably because you restared IIS, the Application Pool, or reboot the machine.  When you make a configuration change, restart the Application Pool or restart IIS.  If you did not restart then the Application Pool just cycled which reset the ES connection.

Any ideas what may be causing this?

This doesn't sound ES related to me.  The ONLY way I could see this happening is if your ES connection is talking to a different database or server than when you talk directly.  The exact same information is passed over for the query regardless of whether you are using the ES or talking directly.  The ES simply communicates between the DAL on the client differently, but if you have the ES side setup with an OracleDataSourceItem with the same connection string, then you will get the same results.

Turn on debugging to see what is being passed to the server.  You can use this in ES and direct modes.

Databasics.DataSources("").SetDebugOn("c:\myoutput.html",True)

Jared Ewald
Jared Ewald
StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)
Group: StrataFrame Users
Posts: 18, Visits: 43
I turned on debugging and found that the exact same (valid) queries are being passed to the server in both situations. In addition, I have verified that the direct connection string and the connection string on the ES are identical. Upon further investigation into this problem, I have discovered that the only case where business objects are not filling is when the FillByPrimaryKey method is used AND the primary key of the object being filled is a Number. (When the primary key is a string, everything works fine. In addition, everything works fine when the data source is switched to the direct Oracle data source.)



Any thoughts?



Thanks for all of the help!



Jared
Jared Ewald
Jared Ewald
StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)
Group: StrataFrame Users
Posts: 18, Visits: 43
I have since checked the queries reaching the server using Oracle Enterprise Manager as well as the server configuration. Everything there seems to be fine. However, business objects that I am trying to fill with fillByPrimaryKey that have a number (System.Decimal) as a primary key are still not being filled when an enterprise server datasource is used instead of a direct Oracle datasource. Does anyone have a solution to this problem?



Thanks,



Jared





Jared Ewald (10/05/2007)
I turned on debugging and found that the exact same (valid) queries are being passed to the server in both situations. In addition, I have verified that the direct connection string and the connection string on the ES are identical. Upon further investigation into this problem, I have discovered that the only case where business objects are not filling is when the FillByPrimaryKey method is used AND the primary key of the object being filled is a Number. (When the primary key is a string, everything works fine. In addition, everything works fine when the data source is switched to the direct Oracle data source.)



Any thoughts?



Thanks for all of the help!



Jared

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
We will just have to setup this scenario.  The problem you are describing just doesn't make any logical sense as it relates to how the ES actually operates.  So the only thing that we can do is setup an ES server here that talks with Oracle and test your situation.  Thanks. Smile
Jared Ewald
Jared Ewald
StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)StrataFrame Beginner (18 reputation)
Group: StrataFrame Users
Posts: 18, Visits: 43
Sounds good. Thanks for all of the help! It is much appreciated! Smile



Jared
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