diff --git a/src/caosdb/common/datatype.py b/src/caosdb/common/datatype.py
index 246485c3957462fc98ac83f9d904413ad7518302..c6468c0f11dac22745cf4ebeed18dac09c15600e 100644
--- a/src/caosdb/common/datatype.py
+++ b/src/caosdb/common/datatype.py
@@ -25,7 +25,8 @@
 
 import re
 
-from ..exceptions import AmbiguityException, EntityDoesNotExistError
+from ..exceptions import (AmbiguityException, EntityDoesNotExistError,
+                          TransactionError)
 
 DOUBLE = "DOUBLE"
 REFERENCE = "REFERENCE"
@@ -111,7 +112,8 @@ def get_id_of_datatype(datatype):
             "Name {} did not lead to unique result; Missing "
             "implementation".format(datatype))
     elif len(res) != 1:
-        raise EntityDoesNotExistError(
+        ee = EntityDoesNotExistError(
             "No RecordType named {}".format(datatype))
+        raise TransactionError(ee)
 
     return res[0].id