The MUD Development forum.
Game Development Discussion, Chat, Technical Debate, and people who just love games talking about building worlds.

Home » Hosted Mud Projects » Wheelmud » General » Move from NHibernate to ServiceStack.ORMLite - WheelMUD - A C# MUD Server - Forums - WheelMUD - Data
Move from NHibernate to ServiceStack.ORMLite - WheelMUD - A C# MUD Server - Forums - WheelMUD - Data [message #458] Sun, 22 March 2015 11:44
Karak is currently offline  Karak
Messages: 489
Registered: March 2015
Location: Seattle, WA
Senior Member
Wheelmud
This thread originates from prior WheelMUD forum software archives. It has been migrated here to preserve the contents.

Post by Fastalanasa (12 May 2012 11:48 PM):
I just completed the move from NHibernate to ORMLite. This move reduced the amount of assemblies that we need, and a lot of unneeded code. We don't need features from the more complicated enterprisy ORMs (<strong>O</strong>bject <strong>R</strong>elational <strong>M</strong>appers) out there. There's the added benefit of ORMLite being the second fastest ORM on the industry, only behind Dapper (by a millisecond). I put the infrastructure to load additional database providers through MEF.
I already coded support for SQL Server, MySQL, PostgreSQL, and Firebird. I'm only including support for SQLite in 0.4.5 (nee 0.5), so that we don't get sidetracked. I'm leaving the code for other providers in the ORMLite branch.
Please reply with any issues that you encounter. Neutral

Post by Karak (13 May 2012 01:06 AM):
Had a quick glance. There were some issues with player authentication, I fixed one [was throwing an exception due to usage of First(Wink instead of FirstOrDefault(Wink]. I tagged another though in PlayerRepository.NoGen.cs that you'll want to look at that, I tagged with "@@@ FIX" - slap a breakpoint there and step during character creation, as it is blocked.

I can't seem to log in with a couple characters I thought I created before too; I usually create a user/password of "asdf"/"asdf" for quick testing but that doesn't seem to exist. I'm not worried about having to recreate them (beyond being blocked on doing so due to the above), just wondering if that was expected?

Post by Karak (13 May 2012 01:13 AM):
It might be nice to have a couple unit tests covering Authenticate passing and failing as expected against a test account username/password pairs?

Post by JFed (13 May 2012 06:35 AM):
Perhaps a little off-topic but has use of MS Entity Framework (code first) been considered? I don't have much experience with it (or ORMs in general) so it's a question out of interest (not an implied suggestion or anytihng).
My understanding is EF has evolved into something.. well, usable in ver 4.2+

Post by JFed (13 May 2012 08:25 AM):
I'm having the same issue as Karak. Creating a new character or logging into an existing one both cause exceptions for me. Entering an invalid username/pass (whether or not user exists) works as usual.

Post by Fastalanasa (13 May 2012 01:03 PM):
Quote:
Posted By Karak on 13 May 2012 01:06 AM
Had a quick glance. There were some issues with player authentication, I fixed one [was throwing an exception due to usage of First(Wink instead of FirstOrDefault(Wink]. I tagged another though in PlayerRepository.NoGen.cs that you'll want to look at that, I tagged with "@@@ FIX" - slap a breakpoint there and step during character creation, as it is blocked.

Meh, I was using the wrong extension method. SQLite is very strict about case sensitivity, so I created a SQLite-specific SELECT statement in that method. It's working now.
Quote:
Posted By Karak on 13 May 2012 01:06 AM
I can't seem to log in with a couple characters I thought I created before too; I usually create a user/password of "asdf"/"asdf" for quick testing but that doesn't seem to exist. I'm not worried about having to recreate them (beyond being blocked on doing so due to the above), just wondering if that was expected?

Unless you deleted them (or I checked in a "clean" database), they should still be there. Give it a whirl, after you get latest from the repo.

Post by Fastalanasa (13 May 2012 01:37 PM):
Quote:
Posted By JFed on 13 May 2012 06:35 AM
Perhaps a little off-topic but has use of MS Entity Framework (code first) been considered? I don't have much experience with it (or ORMs in general) so it's a question out of interest (not an implied suggestion or anytihng).
My understanding is EF has evolved into something.. well, usable in ver 4.2+

It has been unusable long before Microsoft product groups took it over. I was working for Microsoft's consulting arm, Avenade, and they had something called Ava.NET at the time. This was used for Microsoft's and Accenture clients. Microsoft decided to develop AVA.NET further, and that became Entity Framework 1.0. Really hate the thing.
I have created 2 ORM layers from scratch, plus used just about every major ORM out there. As for WheelMUD, I've tried 2 custom built, CSLA, Subsonic, NHibernate, and now ORMLite. ORMLite is the lightest of all these. I picked it because we don't need anything that complicated. Proud

Post by Karak (14 May 2012 12:32 AM):
Yes, login, creation, and now auto-upgrading of an old test account into a proper player document are working again.

Post by JFed (14 May 2012 10:02 AM):
I'm still having issues logging in... having a bit of a hard time determining where and why, I'm getting (caught) exceptions about "Operation could destabalize the runtime" and "Could not find index named: Temp/PlayerDocuments/ByDatabaseID
I'd done a clean compile to see if it helped, and was getting the Storage.Esent errors I was getting before. Adding a reference to it in WindowsService.csproj seems to fix it (the file is copied correctly now automatically during build). Should I commit this? I'd like to know that someone else is getting the same errors on a clean compile before I "fix" too much!

Post by Fastalanasa (14 May 2012 11:33 AM):
Quote:
Posted By JFed on 14 May 2012 10:02 AM
I'm still having issues logging in... having a bit of a hard time determining where and why, I'm getting (caught) exceptions about "Operation could destabalize the runtime" and "Could not find index named: Temp/PlayerDocuments/ByDatabaseID
I'd done a clean compile to see if it helped, and was getting the Storage.Esent errors I was getting before. Adding a reference to it in WindowsService.csproj seems to fix it (the file is copied correctly now automatically during build). Should I commit this? I'd like to know that someone else is getting the same errors on a clean compile before I "fix" too much!

Alright, I put this issue at the top of my pile. Upgraded it to a BLOCKER in Jira. Confused

Post by Fastalanasa (14 May 2012 10:00 PM):
JFed, get latest from Subversion and test it. I created a clean VM with Visual Studio, and was able to reproduce what you were seeing. I just checked in the fix. This is for WMSHARP-103. If this resolves what you are seeing, then I'll close this ticket.

Post by JFed (14 May 2012 10:33 PM):
OK thanks Fast, I cleaned up and recompiled, and don't get Esent errors (I'm at the same point as when I manually copied the references). However, I am still not able to login without getting an exception at runtime.

{"Operation could destabilize the runtime."} in public static void CreateIndexes(Wink when logging in as test/test

Post by Fastalanasa (14 May 2012 10:37 PM):
Alright, create a new forum thread in the Setup forum. We'll continue with this over there.
Previous Topic: GOTO command - WheelMUD - A C# MUD Server - Forums - WheelMUD - Bug Reports
Next Topic: Can't login since ORM change (Exception) - WheelMUD - A C# MUD Server - Forums - WheelMUD - Bug Repo
Goto Forum:
  


Current Time: Thu Nov 23 08:52:58 PST 2017