No nonsense. Direct Source Link: https://git.oschina.net/alexgaoyh/alexgaoyh.git use ehcache to improve the performance of the system, now with a lot of, also support distributed cache, in hibernate as a two-level cache implementation products, can improve query performance. Pom.xml add the ehcache configuration file under src for the project ehcache.xml In the Spring integrated hibernate confi
In the development of the project, often consider to improve user access efficiency, reduce the pressure on the server, this time will use the data cache. There are a number of technologies currently implementing caching,
For example: Jcache, Ehcache, and caching server Redis,redis are important components of a distributed system, and the use of the technology and related issues are described in detail in later articles.
For now, I'm going to mention
1Course PlanMenu Data ManagementRights Data ManagementRole Data ManagementUser Data Managementin the Realm in the dynamic query user rights, RolesS Hiro integrated in Ehcache Cache Permission Data2Menu Data Additions2.1 using combotree parent menu item Data 1. page:menu_add.jsp2, Modify the component style:easyui-combotree, modify the URL tree table treegrid follow down Combotree requires the data format to be basically consistent. Combotree The
When using the Ehcache framework, the two properties of Timetoliveseconds and Timetoidleseconds are easy to confuse and can be recorded today when you are free, in case you forget again.Let's start by explaining what these two properties do: (Of course, these 2 properties are only valid if Eternal is false)Timetoliveseconds-When an object has been cached for more than the Timetoliveseconds property value, the object expires and
refresh interval, and the cache simply refreshes when the statement is invoked. The size (number of references) can be set to any positive integer, keeping in mind the number of objects you cache and the number of available memory resources for the environment you are running. The default value is 1024. The readOnly (read-only) property can be set to TRUE or false. A read-only cache returns the same instance of the cached object to all callers. Therefore, these objects cannot be modified. This
In Ibatis, the framework has built-in support for Oscache, and if we want to use ehcache, we need to implement the functional mechanism of level two caching by hand.
In MyBatis, the development organization provides only some of the default level two cache implementation mechanisms, and does not have a direct built-in support for two-level caching mechanisms such as Oscache and Ehcache, but as an integrated
This article refers to the integration of multiple articles on the web.
1. Required JAR Package
Ehcache-core-2.5.2.jar Slf4j-api-1.6.1.jar Cglib-2.2.jar [----This package may not be needed] Ehcache-spring-annotations-1.1.2.jar Aopalliance.jar
2. Configure Ehcache in spring's configuration file Applicationcontext.xml
Configuration of the 3.ehcache.xml
At this po
In actual use, it is found that the reading operations on the table_info and users tables at the bottom of the Pharos are too frequent. Therefore, the secondary cache is added for these tables to improve performance.0. First modify the hibernate. properties file,AddHibernate. cache. provider_class = net. SF. hibernate. cache. ehcacheproviderHibernate. cache. use_query_cache = true
1. Modify endbran/src/Java/ehcache. xml and add the following content:M
-------------------- * Hibernate. cfg. xml ----------------------------------
"-// Hibernate/hibernate configuration DTD 3.0 // en"Http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd>Org. hibernate. Connection. c3p0connectionprovider
----------------------------- Ehcache. xml ---------------------------------------------------
If the path is a Java System property it is replacedIts value in the running VM.
The following properties are
IntroductionHttp://blog.csdn.net/mgoann/archive/2009/04/17/4086641.aspx
There are multiple cache modes. The cache modes supported by ehcache are as follows:
· Direct Manipulation)
· Push mode (pull-through)
· Self-Filling)
Direct operation (Direct Manipulation)
You can use the method cache. Put (elemtn element) to store objects and get objects through the method cache. Get (ojbect key.
Auto-fill (Self-populating)
You only need to use cache.
Because I am not familiar with springside3, I haven't found the XML file for configuring hiberante for a long time. I finally searched for it and came out:
There is a section in E: \ myeclipseworkplace \ lforum \ webapp \ WEB-INF \ config \ applicationcontext. xml:
Bean ID = "Sessionfactory" Class = "Org. springframework. Orm. hibernate3.annotation. annotationsessionfactorybean" > Property Name = "Datasource" Ref = "Datasource" /> Property Name = "Namingstrategy" > B
, To change to the error folder, you have to write like this, of course, this class can be unified to optimize again, such as ". /error/"Extract to unify settings. Of course, this way can also be used to return to JSON, instead of having to jump to the interface, the JSON may be more in line with the requirements, after all, is now mostly using AJAX to do the interaction. If you change it later, I'll post the code.
Write a Custom exception example
Contents: Com.magic.rent.exception.cu
); SYSTEM.OUT.PRINTLN (user); }}
Configuration Mode 2Enable the spring scanner to comment out the original usermapper beanMapper Configuration Mapperfactorybean: Generate proxy objects based on mapper interface - - mapper batch scan, scan out the Mapper interface from the Mapper package, automatically create proxy objects and register compliance with the Spring container: Keep Mapper.java and mapper.xml mapping file names consistent and automatically scanned in one
faster and easier. All developers are quick to get started, all devices are adaptable, and all projects are available.DistributedDistributed services: Dubbo+zookeeper+proxy+restfulDistributed message Middleware: Kafka+flume+zookeeperDistributed cache: Redis Distributed files: FastdfsLoad balancing: Keepalived+nginx+proxy (triple load)Willing to know the framework of technology or source of friends directly add to seek (Penguin): 2042849237More detailed source code reference: Http://minglisoft.c
, WebLogic 10, WebSphere 8Database support: Currently only support MySQL database, but not limited to the database, the next version of the upgrade multi-data source switching and database read and write separation: Oracle, SQL Server, H2, etc.Support development environment: Eclipse, MyEclipse, Ras, idea, etc.Classic Introduction:SOURCE structureYou are welcome to study the relevant technology togetherWilling to understand the framework of technology or source of friends directly seeking exchan
("Data_name")); }if(Cache! =NULL) {Cache.put (NewElement (CacheKey, value)); }returnValue }}Tool classFinally add, colleagues think this call more convenient, I tried, is indeed. PackageCom.company.mapp.cache;ImportJava.util.Map;ImportCom.company.component.PageData;/** * Cache Tool class * External calls the method of the class directly, hiding the implementation and invocation details of the entire cache framework * * @author ouyida3 * @since 2015.4.4 * * Public class cacheutils { Public
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.