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

  • Home
  • SEARCH
  • 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 967725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:21:54+00:00 2026-05-16T02:21:54+00:00

I know the API state A thread safe client for working with your SQL

  • 0

I know the API state “A thread safe client for working with your SQL Maps”, but I want to understand how it works a little better and was wondering if anyone was running this ina multi-threaded environment with transactions. For instance using:

void doSomeSql() throws SQLException{
  sqlMapper.startTransaction();
  sqlMapper.startBatch();
  final Map paramMap = new HashMap();
  paramMap.put("data", "data"); 
  Integer num = (Integer) sqlMapper.queryForObject("getRowCount", paramMap);//get row count
  sqlMapper.insert("insertData", paramMap); //insert row
  num = (Integer) sqlMapper.queryForObject("getRowCount", paramMap);//get row count again
  sqlMapper.executeBatch();
  sqlMapper.commitTransaction();
}

If this was used on where multiple threads can call this and there is only one shared sqlMapper object would there be some threads that are executing the batch because another thread called executeBatch()? This becomes more of an issue if I have lots of other methods doing delete’s updates etc using the same sqlMapper in other threads.

I dont want start a transaction in one thread, and have another thread commit before the previous thread was done.

I understand I can synchronize on all this, but would rather not have to.

  • 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-05-16T02:21:55+00:00Added an answer on May 16, 2026 at 2:21 am

    Internally, org.ibatis.sqlmap.engine.impl.SqlMapClientImpl uses a ThreadLocal to store it’s internal sessions, so even if many threads share the same SqlMapClient reference, the class uses a different internal object for each thread.

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

Sidebar

Ask A Question

Stats

  • Questions 513k
  • Answers 513k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer No. CCSprite is not retaining the filename. But like you… May 16, 2026 at 5:48 pm
  • Editorial Team
    Editorial Team added an answer The latitude/longitude pair 0/0 is on the equator due south… May 16, 2026 at 5:48 pm
  • Editorial Team
    Editorial Team added an answer To find the "distance" between two strings, a simple method… May 16, 2026 at 5:48 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I want to know the current state(SUSPENDED/READY/RUNNING/WAITING state ) of a thread which has
Does anyone know if there is an API to get the current monitor state
I know that STL has a HashMap API, but I cannot find any good
I know there is a way to programmatically invoice, ship, and set state on
Does anyone know any good chart api for a web application in java? This
I'm attempting to learn Clojure from the API and documentation available on the site.
Question: I'm interested to know the best practice for killing a long standing operation
Take this for example: http://en.wikipedia.org/wiki/United_States_Bill_of_Rights Under the Amendments section, I want to get what
I'm looking for a google search module that uses the 'Google Custom Search API'
Hi i need to use https://api.facebook.com/method/fql.query?query= to get user profile picture and other user

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.