Project Records — Troubleshooting
Here I will record some insightful bugs I encountered in enterprise development, as well as troubleshooting for code
SQL DML Blocking Issue (Oracle)Bug DescriptionRecently, our project needs to receive data from the Big Data department’s interface and perform some update operations on the data before inserting it into a table, which we will refer to as the “Business table” in the following text. During the execution of this operation, it was unexpectedly observed that the execution time exceeded ...
Project Records - Enterprise Requirement
Here will record some of my project requirements in enterprise development.
—————-For quick search and page turning, please see the table of contents on the right———————->
—————For quick search and page turning, please see the table of contents on the right———————–>
————–For quick search and page turning, please see the table of contents on the right————————>
Redisson Distributed Lock
Requirement DescriptionRecently, while working on my project, I found the need to implement caching lo ...
Hexo switch language, suitable for any theme
This article mainly discusses how Hexo achieves internationalization in the simplest way, and this method is highly applicable. I personally think that there is no requirement for which theme to use.
Ideal SolutionThere is a button on the home page, by clicking this button, you can switch the language page with one click (the example of this blog will be Chinese and English). At the same time, the realization of this method does not need to buy a new domain name.
It is worth noting that this met ...
Why anonymous inner class parameters must be final
Recently, when I wrote some anonymous inner classes, I felt a little difficult to understand, so I reviewed this part again. I found some points that I didn’t notice before - the formal parameters of the anonymous inner class must be prefixed with final (unless the anonymous inner class does not use it)
So, how to understand the principle behind this matter?
How inner classes workFirst, think about how inner classes work. We know that after the internal class is successfully compiled, it will ge ...
The actual process of class initialization
Class initialization orderMany people know that the order of class initialization is as follows:(1) Call the base class constructor and repeat this process until the bottom layer(2) Then call the initialization methods of the members in the order of declaration(3) Call the body of the class constructor
The actual process of class initializationHowever, consider this example:
12345678910111213141516171819202122232425262728293031class Animal{ public void walk(){ System.out.println(" ...
Oracle SQL optimization
ProblemRecently, I encountered a problem when writing a SQL, and the execution time of SQL was too long:
1234567891011121314151617select'A' as type,count(adl.is_attend) as count,round(sum(case when adl.is_attend = 1 then 1 else 0 end)/ count(adl.is_attend),2) * 100 as ratefromattendance adlinner join (select deptId from department start with deptId = '...' connect by up_daptId = prior deptId) as nbd on adl.deptId = nbd.deptIdwhere to_date(adl.date,'yyyy-MM-dd& ...
MySQL Data Backup
“This blog post is intended to document the new knowledge I’ve acquired during the learning process, specifically about how to perform data backup in MySQL. If needed in the future, it can serve as a reference.”
Take a look at the code directly.
123456789101112Q1:SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;Q2:START TRANSACTION WITH CONSISTENT SNAPSHOT;/* other tables */Q3:SAVEPOINT sp;/* Time 1 */Q4:show create table `t1`;/* Time 2 */Q5:SELECT * FROM `t1`;/* Time 3 */Q6:ROLLBACK TO ...
Method Static Dispatch
This example is referencing the book “Understanding the Java Virtual Machine”.
Firstly, contemplate the expected output of the following code:
1234567891011121314151617181920212223242526272829public class StaticDisptach{ static abstract class Human{} static class Man extends Human{} static class Woman extends Human{} public void sayHello(Human people){ System.out.println("hello,people"); } public ...
Intranet projects avoid pitfall
As we all know, some projects are completely established in the offline mode of the intranet. The first time I came into contact with this offline mode project recently, record the problems encountered:
Maven offline modelDue to the requirements of the intranet, the project is running on a virtual machine, and the development environment cannot be connected to the Internet on the virtual machine, so all projects need to be downloaded again. There was a problem when configuring pom.xml, and idea ...
Initialization of Java virtual machine class loading
We know that “Java Virtual Machine Specification” chapter 5.5 Initialization ^(1)^ strictly stipulates that there are only six situations where the class must be initialized immediately:
Encountered new (instantiated object), getstatic (read a class static field which is not modified by final or does not put the result into the constant pool at compile time), putstatic (set a class static field which is not modified by final or does not put the result into the constant pool at compile time) or ...