Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transactional Support in Spring Data Elastic Search

I am working with Spring Data Elasticsearch , Spring Data has support for Transactional queries .

This i am enabling by @Transactional annotation.

But since elasticsearch does not have any ACID properties what does this Transactional do, the documentation itself is not clear about this

like image 484
Abhishek Ranjan Avatar asked Dec 22 '15 20:12

Abhishek Ranjan


People also ask

How does Spring data support transaction management?

The Spring Framework provides a consistent abstraction for transaction management that delivers the following benefits: Consistent programming model across different transaction APIs such as Java Transaction API (JTA), JDBC, Hibernate, Java Persistence API (JPA), and Java Data Objects (JDO).

Can we use @transactional in repository?

The usage of the @Repository annotation or @Transactional . @Repository is not needed at all as the interface you declare will be backed by a proxy the Spring Data infrastructure creates and activates exception translation for anyway.

Why ElasticsearchTemplate is deprecated?

The ElasticsearchTemplate class is deprecated as it uses the TransportClient to access Elasticsearch, which itself is deprecated since Elasticsearch version 7. + Users should switch to ElasticsearchRestTemplate or ReactiveElasticsearchTemplate .

What is @document annotation in Spring boot?

@Document is an annotation provided by Spring data project. It is used to identify a domain object, which is persisted to MongoDB. So you can use it to map a Java class into a collection inside MongoDB. If you don't use Spring Data, you don't need this annotation.


1 Answers

On Spring Data Elasticsearch, it does nothing. It's an annotation from Spring Data Commons, but not all stores support all attributes and features from that.

like image 193
P.J.Meisch Avatar answered Sep 18 '22 14:09

P.J.Meisch