Comments (4)
The current logger is a class instance:
private final Log logger = LogFactory.getLog(getClass());
This was probably copy pasta from elsewhere that actually needed to use getClass(). I don't see any reason why the Log can't be static with SpringManagedTransaction.class
passed to getLog() .
from spring.
Some time ago (in the times of RCs) Simo advised us to change that due to this:
http://wiki.apache.org/commons/Logging/StaticLog
Not sure if using statics is a real problem given that this is how the whole spring framework is coded...
from spring.
If this is a deliberate use of the transient logger pattern, then it needs to be applied across the board to do much good. At present, only SpringManagedTransaction and SqlSessionFactoryBean have non-static loggers (and it's inconceivable to me that only mybatis-spring and not mybatis core would be deployed in a shared directory). Also, the implementation of LogFactory in mybatis-3.2.2 is incompatible with repeated calls to getLog(): it's simply too slow to be used this way.
Hunter's point about the misuse of getClass() is also well taken. There may be times when this is an appropriate thing to do, but they are rare, and this is not one of them.
from spring.
Yep, that code does not make sense I will change it to the classic method.
from spring.
Related Issues (20)
- The query cache is not cleared after transaction rolls back to a savepoint HOT 3
- mapperLocations is overwritten HOT 1
- SqlSessionFactoryBean single resource, using wildcard causes a IOException HOT 4
- When Spring has multiple ApplicationContexts, it may throw BeanCreationNotAllowedException HOT 1
- Update dependency org.mybatis:mybatis to v3.5.13 on 2.1.x
- fix: change the event type that SqlSessionFactory is listening to on 2.1.x
- Drop support 1.3.x and 2.0.x
- Support processPropertyPlaceHolders option in mapper:scan and @MapperScan
- does mybatis-spring support to use customized mapper excludeFilters? HOT 1
- The logic regarding transaction rollback seems incorrect HOT 3
- The latest springboot using mybatis-spring-stater 3.0.2 throw exception "Invalid value type for attribute 'factoryBeanObjectType': java.lang.String" HOT 6
- The first query of maybatis takes longer than the second query. How to warm up in advance? HOT 1
- Switch baseline to Spring 6.1 and Spring Batch 5.1
- Support JDK 22 on CI
- why not override postProcessBeanDefinition method in ClassPathMapperScanner
- The latest springboot using mybatis-spring-stater 3.0.3-SNAPSHOT throw exception "Invalid value type for attribute 'factoryBeanObjectType': java.lang.String" HOT 5
- An idea to adapt to Spring 6.1 HOT 3
- MyBatisSystemException message is null
- Why @MapperScan scan all interface? Maybe only scan annotated with @Mapper is better? HOT 2
- mybatis-spring official docs for english responds 404 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring.