• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

can you explain

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
public NoteEntity CreatePlayerNote(NoteEntity note)
{
IsolationLevel isolationLevel = IsolationLevel.ReadCommitted;
if (note.NoteType == NoteType.ALERT)
{
isolationLevel = IsolationLevel.Serializable;
}

Execute(delegate(ISession session, ITransaction transaction)
{
if (note.NoteType == NoteType.ALERT)
{
ICriteria select = session.CreateCriteria(typeof(NoteEntity)).Add(Expression.Eq("PlayerIx", note.PlayerIx))
.Add(Expression.Eq("NoteType", (Int32)note.NoteType));

var oldNote = select.UniqueResult<NoteEntity>();

if (oldNote != null)
{
oldNote.ActionDescription = "Alert changed from [" + oldNote.Text + "] to [" + note.Text + "] by AdminIx [" + note.AdminIx + "]";
oldNote.NoteType = NoteType.PLAYER_NOTE;
session.Update(oldNote);
}
}

session.Save(note);

}, isolationLevel);

return note;
}
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic