Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Using Umbraco 7.15.3 and everytime i restart my application, then the first time it runs DatabaseContext.Database.GetTransaction() it gets a null exception. If i then skip the error and try to run it again, it works, until next restart.
First it runs GetAll, then i try to insert a comment into the database with the Insert method.
// UmbracoServices.Database is equal to UmbracoContext.Current.Application.DatabaseContext.Database
public static void Insert(Comment newEntry)
using (var transaction = UmbracoServices.Database.GetTransaction())
var post = UmbracoServices.Database.SingleOrDefault<Post>(newEntry.PostId);
post.LastReplyDate = newEntry.CreateDate;
public static IEnumerable<Comment> GetAll(int postId)
var comments = new List<Comment>();
var query = new Sql().Select("*")
.Where("postId = @0", postId);
The error i get looks like this. enter image description here
The database looks like this. enter image description here
Does anyone have an idea?
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted