Entity Framework and View

Entity Framework is a really useful way for .NET developers to interact with databases. Recently, I have been working on implementing oData using WCF(Windows Communication Foundation).

A quick overview on oData:

Since, data in the data warehouse contains sensitive and too much details. It is necessary in this case to create a small subset of data using View. The fun begins with Entity Framework seems to have issues when creating and updating the data structure. Common errors are:

“1. The table/view TABLE_NAME does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity, you will need to review your schema, add the correct keys, and uncomment it”

This can be resolved easily. For example, if you Table Primary Key column is “ID”, in your View, you have to add this code, ISNULL(ID, – 1) AS ID.

2. Unable to update the EMDX – View mapping errors.

This is a little bit more complicated and workaround is found by manually editing the EMDX file using the XML Editor.

  1. Remove the <DefiningQuery>…<DefiningQuery>
  2. Remove store:Name=”XXXX” attribute from the <EntitySet> tag
  3. Remove the store prefix from the store:Schema attribute in the <EntitySet>

Now you can update your model again.

How to install Infobright on Ubuntu

Recently, I have to investigate an opensource data warehousing software and my first choice is Infobright (http://www.infobright.org/).

The installation process is pretty simple except one error:

/usr/bin/strings: ‘/lib/libc.so.6’ : No such file

This can be solved easily by creating a symlink to the location of the file

1. Locate the file

locate libc.so.6

2. Create a symbolic link

# ln -s /path/to/libc.so.6 /lib/libc.so.6

Then you need to have MySql (if you haven’t had one)

> sudo apt-get install mysql-server

Installation process

1. Download the deb file from infobright website: http://www.infobright.org/

2. Make sure you are root

> su –

3. Navigate to a directory, ie /usr/local

# cd /usr/local

4. Install infobright

# dpkg -i /path/to/file.deb

5. Make sure that infobright is working properly.

More information about infobright can be found at http://www.infobright.org/wiki/