0

I have a legacy application that has recently been ported from Struts to Spring MVC. The data layer is written with native Oracle SQL. I'd like to introduce some integration testing but would like to avoid using an actual Oracle database for obvious reasons. Is there an in-memory DB that can deal with Oracle native SQL? Is this just a dream? Am I just going to end up with Oracle XE in a VM?

5
  • I'm sorry, but the reasons for wanting to do integration testing without an actual database are not so obvious . . . I can't even begin to imagine how one might test a database application without a database ... Commented Feb 22, 2020 at 16:14
  • @EdStevens I guess the reasons for not wanting an actual Oracle database of Integration testing aren't so obvious. 1) having to manage a centralized schema for integration 2) network latency 3) sharing a database with multiple people doing Integration testing. I'm sure there are more reasons, but those are the first that come to mind. Commented Feb 22, 2020 at 19:19
  • @EdStevens I have worked on MongoDB based applications that had integration tests that could be run offline and by multiple developers without requiring a common DB configuration external to the app code. It was almost trivial to have an in-memory MongoDB instance to run tests against. Commented Feb 22, 2020 at 19:51
  • "It was almost trivial to have an in-memory MongoDB instance to run tests against." So you DO have a database to test against ("an in-memory MongoDB instance"). You just architect it a bit differently. Commented Feb 23, 2020 at 15:05
  • @EdStevens, I was using my MongoDB instance as an example. This is a completely different project, one that is based on JDBC and Oracle native SQL. Commented Feb 23, 2020 at 19:03

2 Answers 2

1

I've discovered that H2 actually has an Oracle compatibility mode. Great!

spring.datasource.url=jdbc:h2:mem:testdb;Mode=Oracle
spring.datasource.platform=h2
spring.jpa.hibernate.ddl-auto=none
spring.datasource.continue-on-error=true
Sign up to request clarification or add additional context in comments.

Comments

0

Isn't Oracle's in-memory database, TimesTen, compatible with standard Oracle?

1 Comment

Ah, interesting. I didn't know about TimesTen. Do you have an example of how I can define that inside a Gradle or Maven script?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.