Hi Stein,this exception is cause by the fact that Axon doesn't recognize the String "DB2/LINUXX8664" as a known database. It uses the database name to detect which exceptions indicate an optimistic locking error.There are two ways around this:1. disable the inspection. Simply remove the data-source property from the jpa-event-store, and you're done.2. customize the persistence exception resolver. Remove the data-source property, and replace it with persitence-exception-resolver, lke so:<axon:jpa-event-store persistence-exception-resolver="persistenceExceptionResolver"/><bean id="persistenceExceptionResolver" class="org.axonframework.eventstore.jpa.SQLErrorCodesResolver"><constructor-arg value="DB2"/></bean>Since you're using DB2, which is a known DB type, you can simply provide the database name as a constructor to the SQLErrorCodesResolver.Hope this helps.Cheers,Allard
On Fri, Sep 26, 2014 at 1:30 PM, Stein Welberg <st...@onegini.com> wrote:
Hi Allard,Is it possible to use DB2 as database for the Axon tables?Currently I’m getting the following exception:org.springframework.beans.MethodInvocationException: Property 'dataSource' threw exception; nested exception is org.axonframework.common.AxonConfigurationException:The database product name 'DB2/LINUXX8664' is unknown. No SQLCode configuration is known for that database.Thnx!
Met vriendelijke groet / Kind regards,Stein Welberg | CTO
<Onegini logo small signature[18].png>
M: +31639110574 | st...@onegini.com | Pompmolenlaan 9, 3447 GK, Woerden | www.onegini.comVisit www.onegini.me to create your own Onegini digital identity today!
--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
@Bean
public Serializer serializer() {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
return new JacksonSerializer(objectMapper);
}
// An own resolver is needed because Axon doesn't recognize DB2 on linux correctly
@Bean
public SQLErrorCodesResolver sqlErrorCodesResolver() {
return new SQLErrorCodesResolver("DB2");
}
@Bean
public EventStorageEngine eventStorageEngine(DataSource dataSource) throws SQLException {
EntityManagerProvider entityManagerProvider = new SimpleEntityManagerProvider(entityManager);
return new JpaEventStorageEngine(
serializer(), NoOpEventUpcaster.INSTANCE, sqlErrorCodesResolver(),
null, entityManagerProvider, NoTransactionManager.INSTANCE,
null, null, true);
}
--