
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.



== Implementation

The framework provides a number of default implementations for JPA and JDO, to recognise:

* data already exists (uniqueness constraints)
* object not found
* related data exists (foreign key constraints preventing change)
* unable to save data (foreign key constraints not met)
* other data access problem based on a particular type that they throw, xref:refguide:applib:index/services/exceprecog/ExceptionRecognizerForType.adoc[] and its subclass in turn, xref:refguide:core:index/metamodel/services/exceprecog/ExceptionRecognizerForRecoverableException.adoc[]



=== Configuration Properties

The following configuration property is relevant:

[cols="2a,1,3a", options="header"]
|===
|Property
|Value +
(default value)
|Description

| `causeway.core.runtime-services.` +
`exception-recognizer.dae.disable`
|`true`,`false` +
(`false`)
|whether any `DataAccessException` exceptions should be recognized.+

If Spring encounters a data access problem (either JPA or JDO) then it will throw a subclass of `DataAccessException`.

This recogniser catches this exception class and throws a suitable recognition based on the subtype.

By default, this is enabled.
Disable it only if you need to fine-tune the built-in behaviour.


|===

