C# – Subsonic 3.0.0.3: issues with load slowdowns

csubsonicsubsonic-active-recordsubsonic3

I'm using subsonic 3.0.0.3 (active record) quite a simple database really, have trusted in its abilities but i am really getting let down by how incredibly slow it it to do anything.

For some reason it likes to run through things more than once.
For example:

var newitem = new new_quote_item
{
  quote_id = Convert.ToInt32(newQuoteID),
  isextra = true,
  qty = qty,
  measureX = 0,
  measureY = 0,
  prodid = Convert.ToInt32(prodid)
};

newitem.Save();
// claculate price and add to total
var iteminfo = extra.SingleOrDefault(x => x.id == Convert.ToInt32(prodid));

that will run twice, but inside extra ( the subsonic classes) this can be 3 or 4 loops, really should it be able to create this class once? Why does it have to be initialized, then initialized all over again.

Has anyone had this kind of trouble before?
It shouldn't take 20 mins to get back a simple quote.

Thanks

Best Answer

You're doing 2 things here: 1) Saving a new class 2) Pulling the record back out.

This will result in two queries - one to INSERT, the other to SELECT. There are no "loops" and I have no idea what you're saying about 3 or 4 loops and "creating the class once". You write the code - you have the object already.

Ad far as 20 minutes goes - that's not SubSonic my friend. As you noted here subsonic, mvc and activerecord

SubSonic is pretty quick and won't take 20 seconds. Check the memory on your server.