Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8292531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:30:45+00:00 2026-06-08T13:30:45+00:00

I have a baseDAO which contains methods for basic CRUD operations. And for each

  • 0

I have a baseDAO which contains methods for basic CRUD operations. And for each operation we are doing getJpaTemplate.xxx() operation.
The code is working fine in production, but now we have to write UTs for DAO layer and we are using DBUnit.

I saw the examples and writing the DBUnit classes, I observed that read operations work fine but Delete, update and Create operations are not working at all.
When we are trying to call DAO.save(object) it doesn’t throw any exception, it comes to next line but when I try to open the table and see the value, the new row is not inserted neither that transaction fails nor any exception is thrown.

I doubt there might be issue with connection.
For the reference I am attaching getConnection() method.

protected IDatabaseConnection getConnection() throws Exception { 

 Connection con = dataSource.getConnection(); 
 DatabaseConnection connection = new DatabaseConnection(con); 
 DatabaseConfig config = connection.getConfig(); 
 config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY,new oracleDataTypeFactory()); 
 return connection; 
}

We have another method which is called in setup () for populating the data from the XML file, which works fine. Just for reference I am adding code here.

protected void insertData (String xmlDataFilePath) { 
    IDatabaseConnection dbConnection= getConnection(); 
    TransactionOperation.CLEAN_INSERT.execute(dbConnection,getDataSet(xmlDataFilePath));
    connection = jPATransactionManager.getDataSource().getConnection(); 
    connection.setAutoCommit(false); 
    savepoint = connection.setSavepoint("Data inserted in db"); 
    dbConnection.close();
}

I am not sure without seeing the new row inserted in the db, how to proceed further.
Because I tried doing

 getJpaTemplate().save(object);
 getJpaTemplate().load(ClassName.class, object's id);

which returns me null and in db table also there is no entry.

Any suggestions please?

Thanks in advance.

JE.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:30:48+00:00Added an answer on June 8, 2026 at 1:30 pm

    savepoint = connection.setSavepoint(“Data inserted in db”);

    make sure when the savepoint gets committed?
    can you please put all relavant APIs code here?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code that looks like follows: public interface BaseDAO{ // marker interface }
I have a process which updates a tree to the database, and in doing
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
**Have it working now. I forgot to populate the Array List. How embarrassing. I'm
Have finally got a responsive site working (of a fashion). What I want to
Have some code: using (var ctx = new testDataContext()) { var options = new
Have a look at the following code to find X^y. /* Find exponent in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.