added check for log enabled before showing log to prevent getting size of the list for every queued item if we're not debugging. also added a param for optimizing how we save to the DB so that we can speed up inserts for a clean new item in the DB.
fixed the getwherestatement and serialized object values
fix for autoincrementing primary key