implement distributed transations management in the campus system zhuo zeng
TRANSCRIPT
![Page 1: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/1.jpg)
Implement distributed transations Management in the Campus Syste
mZhuo Zeng
![Page 2: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/2.jpg)
Layers
Three layers:
1. Presentation Layer
2. Application Layer
3. Data Mapping Layer
![Page 3: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/3.jpg)
Database
• 3 tables:
![Page 4: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/4.jpg)
Data-Mapping
• <hibernate-mapping>• <class name="com.zz.po.User" table="[USER]" >• <id name="userid" type="java.lang.Long">• <column name="userid" />• <generator class="identity" />• </id>• <property name="username" type="java.lang.String">• <column name="username" />• </property>• <property name="password" type="java.lang.String">• <column name="password" />• </property>• <property name="truename" type="java.lang.String">• <column name="truename" />• </property>• <property name="birthday" type="java.lang.String">• <column name="birthday" />• </property>• <property name="telephone" type="java.lang.String">• <column name="telephone" />• </property>• <property name="email" type="java.lang.String">• <column name="email" />• </property>• <property name="usertype" type="java.lang.Integer">• <column name="usertype" />• </property>• <property name="lock" type="java.lang.Integer">• <column name="lock" />• </property>• </class>• </hibernate-mapping>
![Page 5: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/5.jpg)
Strust+Spring+Hibernate
![Page 6: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/6.jpg)
Connection Pool
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" p:driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver"p:jdbcUrl="jdbc:sqlserver://localhost:1433;databaseName=Admin"
p:user="sa" p:password="123456" p:maxPoolSize="40" p:minPoolSize="1"
p:initialPoolSize="1" p:maxIdleTime="20" />
![Page 7: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/7.jpg)
Transaction
The simplistic view of a transaction issued to the database using SQL is as follows:
1. Begin the transaction using begin transaction command.
2. Perform various deleted, update or insert operations using SQL queries.
3. If all the operation are successful then perform commit otherwise rollback all the operations.
![Page 8: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/8.jpg)
Transaction
• </bean>• <bean class="org.springframework.transaction.interceptor.TransactionInter
ceptor" id="transactionInterceptor">• <property name="transactionManager" ref="transactionManager"/>• <property name="transactionAttributes">• <props>• <prop key="add*">PROPAGATION_REQUIRED</prop>• <!--PROPAGATION_REQUIRED:Support a current transaction; create a new one if none exists.!->
• <prop key="modify*">PROPAGATION_REQUIRED</prop>• <prop key="update*">PROPAGATION_REQUIRED</prop>• <prop key="log*">PROPAGATION_REQUIRED</prop>• <prop key="*">PROPAGATION_SUPPORTS,readOnly</prop>• <!--PROPAGATION_SUPPORTS:Support a current transaction, execute non-transactionally if none exists.!-->
• </props>• </property>• </bean>
![Page 9: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/9.jpg)
Login
![Page 10: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/10.jpg)
Administrator
![Page 11: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/11.jpg)
Student Management
![Page 12: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/12.jpg)
Teacher Management
![Page 13: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/13.jpg)
Course Management
![Page 14: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/14.jpg)
Teacher Management System
![Page 15: Implement distributed transations Management in the Campus System Zhuo Zeng](https://reader035.vdocument.in/reader035/viewer/2022062321/56649e245503460f94b1248e/html5/thumbnails/15.jpg)
Student Management System