O'Reilly logo

NHibernate 3 Beginner's Guide by Gabriel N. Schenker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What to do if we don't own the database?

Here, we face a serious problem! We have no guarantees that the data in the database conforms to the rules we defined in our application. If our application, for example, expects and postulates that there can be no order in the system without an associated Customer, and another application that we do not control has written orders to the database that do not have this association, then a subsequent load operation for this order might fail and our application throws an exception.

Is this behavior acceptable? If not, what should we do? Basically, we have two possible strategies:

  1. Do not load wrong or incomplete data. Inform the user about the fact that the data is not in the expected format. The user can then ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required