I'm new to mybatis, I want to know does mybatis provide some method such as refreshAndLock like toplink? How can I make sure that the record I select can't be modified by other thread.
Does myBatis provide some method such as refreshAndLock?
1.2k Views Asked by mengying.ye At
2
There are 2 best solutions below
0
Stefan Isele - prefabware.com
On
As far as I know, Ibatis does not support any locking, not even optimistic, let alone pessimistic locking.
Most Java applications use optimistic locking only, may be you can give it a try. You can add optimistic locking to iBatis yourself, here it is explained how to do that with spring : optimistic-locking-on-ibatis
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in MYBATIS
- Postgres && statement Error in Mybatis Mapper?
- Mybatis-plus doesn't work! ERROR INFO:org.mybatis.spring.MyBatisSystemException
- SpringBoot is not picking Application.properties from src/main/resources
- Why can't I correctly use ibatis
- Bulk Insert with Spring-boot and my mybatis
- Is it possible to call a new query within a conditional statement in MyBatis?
- SaaS multi_tenant questions
- throw UnsupportedOperationException: null while using mybatis
- Spring Boot Can't Connect To MySQL,"Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required"
- Is it acceptable to perform an update operation within a @GetMapping method in Spring MVC?
- How to enable transaction logging in a Springboot&MyBatis project?
- springboot mvc web project works fine eventhough resultType in Mapper.xml is different from type in java code
- Spring integration mybatis failed throws: java.lang.TypeNotPresentException: Type org.apache.ibatis.session.SqlSessionFactory not present
- NoClassDefFoundError: org/apache/ibatis/reflection/ExceptionUtil
- Mybatis return -1 when insert and update query execute
Related Questions in TOPLINK
- Ant continues to add the wrong jar file to the classpath even after I've changed it
- @ManyToOne where target PK is part of FK
- TopLink JPA EntityManager flush and Oracle on update trigger
- Toplink to Eclipselink migration support
- java Oracle db eclipse TopLink RelationalDescriptor without primary key: is it possible?
- Jpa getSingleResult() behoviour if no entity is there sometimes it's shows exception and sometime it's shows error
- JPA query with left join and "not exists"
- DatabaseAccessor not connected in a high load scenario
- PLSQL stored procedure query(toplink) returns bigdecimal fields without fraction
- Named query not found for NamedPLSQLStoredProcedureQuery
- Error: The object of class String, from mapping could not be converted to [class java.sql.Timestamp]
- How do I submit two forms from a single page in adf?
- Weblogic transaction handling (TopLink)
- Eclipselink error 3002
- Simplest way to migrate from older JPA to newer with version with Query.getResultList() returning List<Object[]> instead of List<Vector>
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
mybatis does not have such method. mybatis is too low level for this. You need to do that manually.
For pessimistic locking this would look like this:
<select id="refreshAndLock" resultType="YourType"> SELECT * FROM TableStoringYourType WHERE id = #{id} FOR UPDATE </select>