Home » Java » java – Using Akka Persistence, How can I persist data into a Oracle Table-Exceptionshub

java – Using Akka Persistence, How can I persist data into a Oracle Table-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

Using Akka Persistence, How can I persist data into a Oracle Table.

Akka normally persist data into DB in its standard format. JournalTable in JournalRow format.

But Suppose I want to create an Employee Table with composite primary say combination of emp id, firstname and lastname and other columns like address, city, pincode, etc.

In Spring Hibernate, we create entity which is similar to db table and we persist data by calling save on entity object.

How can we do same in Akka Persistence in Java.

This implementation is not clear to me. Also not the way I want.
A simple example will help.

https://doc.akka.io/docs/akka-persistence-jdbc/3.5.2/index.html#custom-dao-implementation

Reply much appreciated.

Thanks a lot.

How to&Answers:

Akka Persistence is not a general purpose database abstraction like Hibernate but a library for doing EventSourcing (see for example https://docs.microsoft.com/en-us/azure/architecture/patterns/event-sourcing).

If you want to do general database operations/CRUD you will have to use some other library for that.