| 2151 | } |
| 2152 | |
| 2153 | pub async fn commit(&self, session_id: &Uuid) -> Result<(), PgSqliteError> { |
| 2154 | // Execute the commit on the current session |
| 2155 | self.connection_manager.execute_with_session(session_id, |conn| { |
| 2156 | conn.execute("COMMIT", [])?; |
| 2157 | Ok(()) |
| 2158 | })?; |
| 2159 | |
| 2160 | // Force all other connections to refresh their WAL view (WAL mode only) |
| 2161 | // This ensures committed data is visible to all other sessions |
| 2162 | self.connection_manager.refresh_all_other_connections(session_id)?; |
| 2163 | |
| 2164 | Ok(()) |
| 2165 | } |
| 2166 | |
| 2167 | pub async fn commit_with_session(&self, session_id: &Uuid) -> Result<(), PgSqliteError> { |
| 2168 | self.commit(session_id).await |