"Interview" "Spring FAQ" "04"

Source: Internet
Author: User

31.5 Types of notifications can be applied to spring facets

l before--Call Notification before the method call.

L after--calls the notification after the method completes, regardless of whether the method execution succeeds.

L after-returning--Call Notification after the live method executes successfully.

L after-throwing--Call Notification when the method throws an exception.

L around--Notification Wraps the method that was notified before the method call is notified and executes the custom behavior after the call.

32, the timing of weaving into

Compilation period-The facets are woven into the target class at compile time.

L class Load period--facets are woven into the target class when it is loaded into the JVM, which requires a special class loader that enhances the target class's bytecode before the target class is introduced to the application

L Run time-the facets are woven at some point in the application's run, and in general, the AOP container creates a representative object dynamically for the target object when it is woven into the plane.

33, Spring provides 4 kinds of unique AOP support

L Agent-based classic AOP.

L @AspectJ Note-driven facets.

L Pure Pojo Slice

L injection-type ASPECTJ (for spring versions).

34. Spring provides several ways to configure the data source Bean in spring up and down

L define the data source through the JDBC driver.

L Find the data source through Jndi.

L The data source of the connection pool.

35. Spring provides the template class for JDBC

L JdbcTemplate: The most basic spring JDBC template, this template supports the most simple JDBC database access function and simple index parameter query.

L Namedparameterjdbctemplate: When you execute a query using this template, you can bind the query value to SQL as a named parameter instead of using simple index parameters.

L Simplejdbctemplate: This template class simplifies the use of JDBC templates by using some of the features of JAVA5, such as auto-boxing, generics, and variable parameters.

36. Spring JDBC Data source

Spring provides two types of JDBC data source objects.

Drivermanagerdatasource: A new connection is returned on each connection request. No data pooling management is in.

Singleconnectiondatasource: The same connection is returned on each connection request.

37. Spring provides some services for the ORM framework

• Integration support for spring declarative things.

L Transparent Exception handling

• Thread-safe, lightweight template classes.

L DAO support class.

L Resource Management.

38. JPA Two types of entity manager

Application Management Type: When an application requests an entity manager directly from the Entity Manager factory, the factory creates an entity manager, in which the program is responsible for opening or shutting down the entity manager and controlling it in things. The entity manager in this way applies to standalone applications that do not run in a Java EE container.

L Container Management Type: Entity manager is created and managed by Java EE. The application does not interact with the Entity Manager factory, and the entity manager is obtained directly through injection or JNDI. The container is responsible for configuring the Entity Manager factory. This type of Entity manager is best used for Java EE containers.

39, the four characteristics of the business

L Atomicity: All operations in a trade (transaction) are either completed or not completed and will not end up in the middle of a link. When an error occurs during execution, the transaction is rolled back (Rollback) to the state before the transaction begins, as if the transaction had never been executed.

L Consistency: The integrity of the database is not compromised until the transaction begins and after the transaction has ended. This means that the data written must fully conform to all the default rules, which include the accuracy of the data, the concatenation, and subsequent databases that can do the scheduled work spontaneously.

L Isolation: When two or more transactions concurrently access the same data in the database that refers to queries and modifications, it shows the interrelationship. Transaction isolation is divided into different levels, including READ UNCOMMITTED, read commit (readcommitted), repeatable read (repeatable Read), and serialization (Serializable).

L Persistence: After the transaction completes, the transaction changes made to the database persist in the database and are complete.

40. Support of Spring Affairs

Spring provides coded transaction management and declarative transaction management.

"Interview" "Spring FAQ" "04"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.