1. Spring 事务的工作原理
Spring 使用两种代理机制来管理事务:
- JDK 动态代理:针对实现了接口的类,Spring 会创建一个实现了相同接口的代理类。事务逻辑通过代理类在方法调用时插入。
- CGLIB 代理:针对没有实现接口的类,Spring 会使用 CGLIB 生成子类代理,拦截方法调用并插入事务逻辑。
不论哪种代理方式,Spring 都是在代理类中对事务进行管理。如果调用来自外部的类,代理对象会拦截该调用并正确地管理事务逻辑。
2. Spring 事务失效场景
大约 2 分钟
Spring 使用两种代理机制来管理事务:
不论哪种代理方式,Spring 都是在代理类中对事务进行管理。如果调用来自外部的类,代理对象会拦截该调用并正确地管理事务逻辑。
最近一直在找前端方向的工作,奈何一直找不到[哭]。现实的重压到了我的头上,焦虑焦虑焦虑。有时候想想又还好,有时候又很焦虑。大一的时候学习的CSharp+Unity本来想一直坚持下去,但是之后被ShaderLab以及美术、建模啥的啥的劝退,然后学习了前端,学了一年自信了不少,结果找不到工作又给我打回去了[哭]。目前想的是把这两结合起来吧。
:::为什么不学Java?
太卷了,太卷了。Java比前端还卷我不想去蹭
:::
类型定义 C# 中的任何数据的结构和行为。 类型的声明可以包含其成员、基类型、它实现的接口和该类型允许的操作。 变量是用于引用特定类型的实例的标签。
JavaSE(Java语言的标准版,Java提供的最基本的类库)
MySQL(数据库)
JDBC(Java语言链接数据库)
WEB前端(会一些)
WEB后端
user www-data;
worker_processes auto;
error_log /etc/nginx/nginx_error.log crit;
pid /run/nginx.pid;
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200; # 一个worker进程可以打开51200个链接
multi_accept on;
}
http
{
include mime.types;
# include luawaf.conf;
# include proxy.conf;
default_type application/octet-stream;
server_names_hash_bucket_size 512;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 200m; // nginx对上传文件大小的限制
sendfile on; # 是否调用sendfile这个函数
tcp_nopush on; # nginx在去处理数据包时是否累计,然后再一起传输
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
gzip on; # gzip 压缩
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";
limit_conn_zone $binary_remote_addr zone=perip:10m;
limit_conn_zone $server_name zone=perserver:10m;
server_tokens off;
access_log off;
server { // 服务一 前台
listen 80; // 监听端口
server_name 116.63.165.100; // 服务器IP
location / {
root /etc/nginx/html/font/dist;
index /index.html;
}
location ^~ /api/ { // 遇到api 代理到 接口地址
rewrite ^/api/(.*)$1 /$1 break;
proxy_pass http://120.46.214.246:8080;
}
}
server { // 服务一 后台
listen 81; // 监听端口
server_name 116.63.165.100; // 服务器IP
location / {
root /etc/nginx/html/backend/dist;
index /index.html;
}
location ^~ /api/ { // 遇到api 代理到 接口地址
rewrite ^/api/(.*)$1 /$1 break;
proxy_pass http://120.46.214.246:8080;
}
}
# 前台测试
include /www/server/panel/vhost/nginx/*.conf;
}
提示
MongoDB常用语句 | 非关系数据库 |
JSP脚本jsp注释的内容不会出现在生成的servlet中
<%-- 注释的内容 --%>