@@ -180,6 +180,9 @@ public void WriteSerializedFile(string relativePath, string fullPath, string con
180180 int serializedFileId = m_SerializedFileIdProvider . GetId ( Path . GetFileName ( fullPath ) . ToLower ( ) ) ;
181181 int sceneId = - 1 ;
182182
183+ using var transaction = m_Database . BeginTransaction ( ) ;
184+ m_CurrentTransaction = transaction ;
185+
183186 var match = m_RegexSceneFile . Match ( relativePath ) ;
184187
185188 if ( match . Success )
@@ -195,6 +198,7 @@ public void WriteSerializedFile(string relativePath, string fullPath, string con
195198 // dirty trick to avoid inserting the scene object a second time.
196199 if ( relativePath . EndsWith ( ".sharedAssets" ) )
197200 {
201+ m_AddObjectCommand . Transaction = transaction ;
198202 m_AddObjectCommand . Parameters [ "@id" ] . Value = sceneId ;
199203 m_AddObjectCommand . Parameters [ "@object_id" ] . Value = 0 ;
200204 m_AddObjectCommand . Parameters [ "@serialized_file" ] . Value = serializedFileId ;
@@ -218,10 +222,9 @@ public void WriteSerializedFile(string relativePath, string fullPath, string con
218222 ObjectIdProvider = m_ObjectIdProvider ,
219223 SerializedFileIdProvider = m_SerializedFileIdProvider ,
220224 LocalToDbFileId = m_LocalToDbFileId ,
225+ Transaction = transaction ,
221226 } ;
222227
223- using var transaction = m_Database . BeginTransaction ( ) ;
224- m_CurrentTransaction = transaction ;
225228 ctx . Transaction = transaction ;
226229 try
227230 {
0 commit comments