当前位置:网站首页>Interview pit summary I
Interview pit summary I
2022-06-26 15:47:00 【YMY_ six hundred and sixty-six】
JVM Will two objects in the reference be recycled ?
Can't , Strongly referenced objects are not recycled
hashMap Why rewrite hashcode and .equals Method ?
It should be a static inner class Node Rewrote , For comparison key,value Decide whether to replace or append in the form of a linked list
rabbitmq If an exception occurs during message listening, how can I return to the queue and keep blocking ?
Return to the team and be consumed by other consumers
@Controller What does the annotation return ?
Return the template engine view name
@Component Annotations marked on interfaces or abstract classes can create injections bean Do you ?
You can't , Interface cannot be instantiated
spring How to inject mybatis Of mapper Interface ?
mybatis There is one MapperFactoryBean Class implements the spring Of FactoryBean Interface implements its getObject Method ,
Realized FactoryBean Interface bean It's a factory bean, factory bean Realized getObject The object returned by the method can be Autowired and Resource Inject
mysql What is the difference between a primary key index and a normal index ?
Clustered index and general index , Cluster index at B+ The leaf node of the tree , The normal index is located in B+ The non leaf node of a tree
1, The primary key index indexes the data , Then the ordinary index indexes the primary key ID value ( This is innodb in , But if it is myisam in , There is no difference between a primary key index and an ordinary index. They index data directly )
2, When you query with where id=x when , You only need to scan the primary key index once , Then get the corresponding data
But if it is a normal index for query , Then we will scan the ordinary index first , Get the primary key value , Then scan the primary key index , Get the data you need , This process is called back to table
spring When a declarative transaction will fail ?
@Transactional Apply to non public The way to decorate
@Transactional Annotation Properties propagation Setting error
@Transactional Annotation Properties rollbackFor Setting error
Method calls in the same class , Lead to @Transactional invalid ( For example, there is a class Test, One way of it A,A Call the methods of this class B( No matter how B Yes, it is public still private modification ), But the way A There is no declaration to annotate the transaction , and B There are methods . Then the external call method A after , Method B It doesn't work .)
In the program try/catch Exception handled
The database engine does not support transactions
spring Is there any other way to solve circular dependency besides L3 cache ?
RPC and RMI The difference between ?
RPC Is a remote procedure call ,RMI It's different JVM Object sharing between
spring bean Life cycle
spring bean The life cycle flow of the container is as follows :
1、Spring The container depends on bean Instantiate in definition bean.
2、Spring Fill all properties with dependency injection , Such as bean Configuration defined in .
3、 If bean Realization BeanNameAware Interface , Then the factory passes bean Of ID To call setBeanName().
4、 If bean Realization BeanFactoryAware Interface , The factory calls... By passing its own instance setBeanFactory().
5、 If it exists with bean Anything connected BeanPostProcessors, Call preProcessBeforeInitialization() Method .
6、 If bean It specifies init Method ( Of init-method attribute ), Then it will be called .
7、 Last , If it exists with bean Anything connected BeanPostProcessors, Will call postProcessAfterInitialization() Method .
8、 If bean Realization DisposableBean Interface , When spring When container is closed , Would call destory().
9、 If bean It specifies destroy Method ( Of destroy-method attribute ), Then it will be called
mysql How to start a slow query ?
slow_query_log Slow query on state
slow_query_log_file Slow query log storage location ( This directory needs MySQL The writable permission of the running account , Generally set as MySQL Data storage directory )
long_query_time How many seconds does the query take to record
The difference between filter interceptors ?
The underlying implementation principles are different , Filters are based on function callbacks , Interceptors are implemented by dynamic agents .
filter What we achieve is javax.servlet.Filter Interface , And this interface is in the Servlet As defined in the specification , Filter dependency servlet, That is to say, the filter Filter The use of Tomcat Equal container , It can only be found in web Used in program .
And the interceptor is spring A component of .
filter Filter After the request enters the container , But in entering servlet Pre treatment before , The request ends at servlet After processing .
Interceptor Interceptor It's asking for access servlet after , When entering Controller What was pretreated before .
For filter @Order Annotations control the execution order , adopt @Order Controls the level of the filter , The smaller the value, the higher the level, the earlier execution .
When configuring custom Filter when , If you don't specify order( If not specified, it defaults to Integer.MIN_VALUE),init() The execution order is random , but doFilter() Press filter The lexicographic order of the name is executed ;
Interceptor default execution order , It's the registration order , It can also be done through .order() Method to set the control manually , The smaller the value, the earlier to execute .
mysql What will not hit the index ?
The index specification is unreasonable ,sql The parser did not hit the index .
An index in a table is an index based on the largest number of data fields in the table ,sql The parser did not hit the index .( In fact, the index is useless , Finally, the global search )
bool Index the fields of ,sql Selector misses index .
Fuzzy query %like
The index column participates in the calculation , Using functions
Non leftmost prefix order
where Yes null Judge
where It's not equal to
or Operation has at least one field without index
The query result set that needs to be returned to the table is too large ( Beyond the scope of the configuration )
边栏推荐
- Selenium chrome disable JS disable pictures
- Particle filter PF -- Application in maneuvering target tracking (particle filter vs extended Kalman filter)
- Evaluate:huggingface detailed introduction to the evaluation index module
- 音视频学习(一)——PTZ控制原理
- A blog to thoroughly master the theory and practice of particle filter (PF) (matlab version)
- 如何辨别合约问题
- 【ceph】cephfs caps简介
- 反射修改final
- Unable to download Plug-in after idea local agent
- nanoPi Duo2连接wifi
猜你喜欢

nanoPi Duo2连接wifi

Notes on brushing questions (19) -- binary tree: modification and construction of binary search tree
![[problem solving] the loading / downloading time of the new version of webots texture and other resource files is too long](/img/31/d14316dca740590c1871efe6587e04.png)
[problem solving] the loading / downloading time of the new version of webots texture and other resource files is too long
![[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area

「干货」NFT 上中下游产业链全景分析

「幹貨」NFT 上中下遊產業鏈全景分析
![[tcapulusdb knowledge base] tcapulusdb doc acceptance - create business introduction](/img/05/8ec56393cac534cb5a00c10a1a9f32.png)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - create business introduction

High frequency interview 𞓜 Flink Shuangliu join

js创意图标导航菜单切换背景色

【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
随机推荐
Audio and video learning (I) -- PTZ control principle
Notes on brushing questions (19) -- binary tree: modification and construction of binary search tree
NFT 平台安全指南(1)
评价——TOPSIS
[tcapulusdb knowledge base] Introduction to tcapulusdb general documents
[C language practice - printing hollow upper triangle and its deformation]
SVG大写字母A动画js特效
简单科普Ethereum的Transaction Input Data
Selenium saves elements as pictures
AUTO sharding policy will apply DATA sharding policy as it failed to apply FILE sharding policy
Is it safe to open a new bond registration account? Is there any risk?
Solana扩容机制分析(1):牺牲可用性换取高效率的极端尝试 | CatcherVC Research
Use of abortcontroller
我想知道如何通过线上股票开户?在线开户安全么?
安全Json协议
[tcapulusdb knowledge base] tcapulusdb system user group introduction
有Cmake的工程交叉编译到链接时报错找不到.so动态库文件
Summer camp is coming!!! Chongchongchong
Unable to download Plug-in after idea local agent
还存在过有键盘的kindle?