Skip to content

Commit d7252c9

Browse files
committed
nette/database 3.2.9
1 parent 29eb69e commit d7252c9

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

database/cs/exceptions.texy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ Nette Database používá hierarchii výjimek. Základní třídou je `Nette\Dat
1010
Z `DriverException` dědí následující specializované výjimky:
1111

1212
- `ConnectionException` - signalizuje selhání připojení k databázovému serveru
13+
- `ConnectionLostException` .{data-version:3.2.9} - spojení bylo ztraceno během operace (restart serveru, výpadek sítě, idle timeout); před dalším použitím je potřeba se znovu připojit
1314
- `ConstraintViolationException` - základní třída pro porušení databázových omezení, ze které dědí:
1415
- `ForeignKeyConstraintViolationException` - porušení cizího klíče
1516
- `NotNullConstraintViolationException` - porušení NOT NULL omezení
1617
- `UniqueConstraintViolationException` - porušení unikátnosti hodnoty
17-
18+
- `CheckConstraintViolationException` .{data-version:3.2.9} - porušení CHECK omezení
19+
- `DeadlockException` .{data-version:3.2.9} - deadlock nebo serializační konflikt zjištěný serverem; transakce byla zrušena a operaci lze zopakovat
20+
- `LockTimeoutException` .{data-version:3.2.9} - vypršel časový limit při čekání na zámek; příkaz byl přerušen, okolní transakce obvykle zůstává otevřená
1821

1922
Příklad zachytávání výjimky `UniqueConstraintViolationException`, která nastane, když se snažíme vložit uživatele s emailem, který už v databázi existuje (za předpokladu, že sloupec email má unikátní index).
2023

database/en/exceptions.texy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ Nette Database uses an exception hierarchy. The base class is `Nette\Database\Dr
1010
The `DriverException` class is extended by the following specialized exceptions:
1111

1212
- `ConnectionException` – indicates a failure to connect to the database server.
13+
- `ConnectionLostException` .{data-version:3.2.9} – the connection was dropped during an operation (server restart, network failure, idle timeout); a reconnect is required before further use.
1314
- `ConstraintViolationException` – the base class for database constraint violations, from which the following exceptions inherit:
1415
- `ForeignKeyConstraintViolationException` – violation of a foreign key constraint.
1516
- `NotNullConstraintViolationException` – violation of a NOT NULL constraint.
1617
- `UniqueConstraintViolationException` – violation of a uniqueness constraint.
17-
18+
- `CheckConstraintViolationException` .{data-version:3.2.9} – violation of a CHECK constraint.
19+
- `DeadlockException` .{data-version:3.2.9} – a deadlock or serialization failure detected by the server; the transaction was rolled back and may be retried.
20+
- `LockTimeoutException` .{data-version:3.2.9} – a lock-wait timeout was exceeded; the statement was aborted, but the surrounding transaction typically remains open.
1821

1922
The following example demonstrates how to catch a `UniqueConstraintViolationException`, which occurs when trying to insert a user with an email that already exists in the database (assuming the `email` column has a unique index):
2023

0 commit comments

Comments
 (0)