diff --git a/server/mapobjectdb/sqlite_mapobjects.go b/server/mapobjectdb/sqlite_mapobjects.go index 930d734..865a793 100644 --- a/server/mapobjectdb/sqlite_mapobjects.go +++ b/server/mapobjectdb/sqlite_mapobjects.go @@ -30,26 +30,18 @@ values(?, ?, ?) ` func (db *Sqlite3Accessor) AddMapData(data *MapObject) error { - tx, err := db.db.Begin() - - if err != nil { - return err - } - res, err := db.db.Exec(addMapDataQuery, data.X, data.Y, data.Z, data.MBPos.X, data.MBPos.Y, data.MBPos.Z, data.Type, data.Mtime) if err != nil { - tx.Rollback() return err } id, err := res.LastInsertId() if err != nil { - tx.Rollback() return err } @@ -58,11 +50,9 @@ func (db *Sqlite3Accessor) AddMapData(data *MapObject) error { _, err := db.db.Exec(addMapDataAttributeQuery, id, k, v) if err != nil { - tx.Rollback() return err } } - tx.Commit() return nil } diff --git a/server/mapobjectdb/sqlite_test.go b/server/mapobjectdb/sqlite_test.go index d2f2b70..ce780fe 100644 --- a/server/mapobjectdb/sqlite_test.go +++ b/server/mapobjectdb/sqlite_test.go @@ -69,7 +69,7 @@ func TestMapObjects(t *testing.T) { if err != nil { panic(err) } - defer os.Remove(tmpfile.Name()) + //defer os.Remove(tmpfile.Name()) db, err := NewSqliteAccessor(tmpfile.Name()) if err != nil {