@@ -159,6 +159,8 @@ public function prune()
159
159
$ delete = $ this ->getConnection ()->prepare ($ deleteSql );
160
160
} catch (TableNotFoundException $ e ) {
161
161
return true ;
162
+ } catch (\PDOException $ e ) {
163
+ return true ;
162
164
}
163
165
$ delete ->bindValue (':time ' , time (), \PDO ::PARAM_INT );
164
166
@@ -169,6 +171,8 @@ public function prune()
169
171
return $ delete ->execute ();
170
172
} catch (TableNotFoundException $ e ) {
171
173
return true ;
174
+ } catch (\PDOException $ e ) {
175
+ return true ;
172
176
}
173
177
}
174
178
@@ -244,6 +248,7 @@ protected function doClear($namespace)
244
248
try {
245
249
$ conn ->exec ($ sql );
246
250
} catch (TableNotFoundException $ e ) {
251
+ } catch (\PDOException $ e ) {
247
252
}
248
253
249
254
return true ;
@@ -260,6 +265,7 @@ protected function doDelete(array $ids)
260
265
$ stmt = $ this ->getConnection ()->prepare ($ sql );
261
266
$ stmt ->execute (array_values ($ ids ));
262
267
} catch (TableNotFoundException $ e ) {
268
+ } catch (\PDOException $ e ) {
263
269
}
264
270
265
271
return true ;
@@ -316,6 +322,11 @@ protected function doSave(array $values, $lifetime)
316
322
$ this ->createTable ();
317
323
}
318
324
$ stmt = $ conn ->prepare ($ sql );
325
+ } catch (\PDOException $ e ) {
326
+ if (!$ conn ->inTransaction () || \in_array ($ this ->driver , ['pgsql ' , 'sqlite ' , 'sqlsrv ' ], true )) {
327
+ $ this ->createTable ();
328
+ }
329
+ $ stmt = $ conn ->prepare ($ sql );
319
330
}
320
331
321
332
if ('sqlsrv ' === $ driver || 'oci ' === $ driver ) {
@@ -350,6 +361,11 @@ protected function doSave(array $values, $lifetime)
350
361
$ this ->createTable ();
351
362
}
352
363
$ stmt ->execute ();
364
+ } catch (\PDOException $ e ) {
365
+ if (!$ conn ->inTransaction () || \in_array ($ this ->driver , ['pgsql ' , 'sqlite ' , 'sqlsrv ' ], true )) {
366
+ $ this ->createTable ();
367
+ }
368
+ $ stmt ->execute ();
353
369
}
354
370
if (null === $ driver && !$ stmt ->rowCount ()) {
355
371
try {
0 commit comments