Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 674607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:43:33+00:00 2026-05-14T00:43:33+00:00

Im doing a project with C# winforms. This project is composed by: alt text

  • 0

Im doing a project with C# winforms. This project is composed by:

alt text http://img139.imageshack.us/img139/2540/esquemaw.png

  • Client project: Windows Forms where user will call the CRUD operations;
  • Server project;
  • Common Project: This project will hold the models (in the image only have the model Item);
  • ListSingleton Project: Remote Object that will do the operations on the models;

Im trying to use a 3 layers style in which the CLIENT and the SERVER will be the views layer, the LISTSINGLETON will be the controller layer (where all objects are created), and COMMON project is the models layer…

I already have all the communication working, but now I need to work on the persistence of the data in a mysql database. I was trying to use nHibernate but I’m having some troubles.

My main problem is how to organize my hibernate configuration.
– In which project do I keep the mapping? Common project?

  • In which project do I keep the hibernate configuration file (App.config)? ListSingleton project?

  • In which project do I do this:

        Configuration cfg = new Configuration();
        cfg.AddXmlFile("Item.hbm.xml");
        ISessionFactory factory = cfg.BuildSessionFactory();
        ISession session = factory.OpenSession();
        ITransaction transaction = session.BeginTransaction();
    
        Item newItem = new Item("BLAA");
    
        // Tell NHibernate that this object should be saved
        session.Save(newItem);
    
        // commit all of the changes to the DB and close the ISession
        transaction.Commit();
        session.Close();
    

In the ListSingleton project? Altho I had reference to the Common Project in the ListSingleton I keep getting error in the addXml line…


  • And when I have 2 projects one with the models & mappings and another where ill use the hibernate (this project has a reference to the models project), how do i do “cfg.AddXmlFile(“User.hbm.xml”);” I keep geting “Could not configure datastore from file User.hbm.xml” When i use this 2 project structure.

My mapping is correct because I tried with a one-project solution and it worked :X

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:43:33+00:00Added an answer on May 14, 2026 at 12:43 am

    Well I found out the answers to my questions

    In which project do I keep the
    mapping? Common project?

    As Jamie Ide said, yes it should be in the models layer.

    In which project do I keep the
    hibernate configuration file
    (App.config)? ListSingleton project?

    In which project do I do this:

    This configuration file and all hibernate configuration should be in the controller layer, so its in the ListSingleton project;

    And when I have 2 projects one with
    the models & mappings and another
    where ill use the hibernate (this
    project has a reference to the models
    project), how do i do
    “cfg.AddXmlFile(“User.hbm.xml”);” I
    keep geting “Could not configure
    datastore from file User.hbm.xml” When
    i use this 2 project structure.

    You should configure the mapping file as Embedded Resource and Copy if newer at the propierties.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 411k
  • Answers 411k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think you'd send a setDoubleAction: message to the NSTableView,… May 15, 2026 at 7:51 am
  • Editorial Team
    Editorial Team added an answer while (true) wait_for_events handle_events Basically, non-blocking event loop utilizes device… May 15, 2026 at 7:51 am
  • Editorial Team
    Editorial Team added an answer Your problem is that your loop runs synchronously while the… May 15, 2026 at 7:51 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.