Wednesday, December 15, 2010

BOMGR 0220 errors on Business Objects server

The lads in SKSWood Brunei change the service account running Business Objects this week and it cause the server to bring up BOMGR 0220 errors. Below is the solution…

Steps for solution:

1. Stop the WebI service.

2. Log into the Business Objects Configuration Tool. Start\Programs\Business Objects\Configuration Tool 6.5

3. On the Cluster Manager Page. Go to the Service Parameters branch. At the bottom of the screen there is a drop down - select 'Update Service Parameters'. Edit the username and password. Hit next or finish

4. Refresh the ORB. On the Cluster Manager Page. Select ORB. Select 'Define ORB' from the drop down. Then hit the 'Test Ports' button. Once done, hit next.

5. Hit finish. and close the configuration tool.

6. You change the settings for the Distributed COM Configuration Properties by doing the following:

6.1 Start\Run\type 'dcomcnfg'

6.2 In the Applications Tab, you should see at least BusinessObjects.document

6.3 Click on BusinessObjects.document and select 'Default Security' tab. Ensure that Edit Default for Access Permissions and Launch Permissions includes Interactive, System and the service account you are using.

6.4 Go back to the Applications Tab, select BusinessObjects.document and hit properties.

6.5 Select the Identity Tab. Select 'This User'.

6.6 Type in the new account and password.

6.7 Once you have changed the settings there may be a need to reboot your server.

Monday, December 6, 2010

Mocking a View for Unit Testing

Had a very interesting question yesterday asking if it was possible to mock up a database view along side the in-memory SQLLite database we use for ActiveRecord.  Initially I figured it was a simple matter of just finding some form of attribute within the ActiveRecord class definition but it turns out that this is not the case.  Views not not actually supported by the CreateSchema() method we normally use with NHibernate/ActiveRecord.

As a work around you can create a view using the existing connection, for example I want to create a view called “mockview” which is based on the applications table.  All we need to do this is create a method:

private void CreateMockView()
{
    using (IDbCommand command = service.GetConnection().CreateCommand())
    {
        command.CommandText = "Create view mockview as select applicationid from applications";
        command.ExecuteNonQuery();
    }
}

If there is already an ActiveRecord class definition for this you need to decorate the class with the Schema=”none” parameter which will prevent the creation of a table with the same name.

[Serializable , ActiveRecord("mockview ", DynamicUpdate = true, Lazy = false, Schema="none")]
public partial class ApplicationsDAO : ActiveRecordBase    {
………………………….
}

Now you can query this to your hearts content.

If we want to query this but there is no ActiveRecord table definition we can just use a normal datareader, for example;

[Test]
public void GetApplications_Test()
{
    IList<Application> results = Application.FindAll();      // the AR Class
    Assert.IsTrue(results.Count > 0, "Returned values");
    _log.InfoFormat("GetAll Complete returned {0} records", results.Count);

    using (IDbCommand command = service.GetConnection().CreateCommand())
    {
        command.CommandText = "select applicationid from applications";  // the View on the database
        IDataReader reader = command.ExecuteReader();
        Assert.IsTrue(reader["applicationid"].ToString() == “1”, "there should be records in the view!");
    }
}