This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> | |
<persistence-unit name="TestPU" transaction-type="RESOURCE_LOCAL"> | |
<provider>org.hibernate.ejb.HibernatePersistence</provider> | |
<class>list entities here if running as standalone app</class> | |
<properties> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EntityManagerFactory emf = Persistence.createEntityManagerFactory("TestPU"); | |
EntityManager em = emf.createEntityManager(); | |
em.getTransaction().begin(); | |
em.persist(exampleEntity); | |
em.getTransaction().commit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ExampleA a = new ExampleA(); | |
em.getTransaction().begin(); | |
em.persist(a); | |
em.getTransaction().commit(); | |
// ... | |
em.getTransaction().begin(); | |
em.detach(a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>kh.jpa</groupId> | |
<artifactId>example</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<dependencies> | |
<dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tcpdump -i eth0 tcp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#restart network | |
sudo /etc/init.d/network restart | |
#firewalld stop|start | |
sudo systemctl firewalld.service stop|start|status | |
firewall-config | |
- add port for 7001 for WebLogic access (zone=public, port, add 7001/tcp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//check is active | |
TransactionSynchronizationManager.isActualTransactionActive(); | |
//get status | |
TransactionStatus status = TransactionAspectSupport.currentTransactionStatus(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Session s = (Session)em.getDelegate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<logger name="org.hibernate.SQL"> <!-- in persistence.xml can also do property name="hibernate.show_sql" value="true" --> | |
<level value="debug"/> | |
</logger> | |
<logger name="org.hibernate.type"> | |
<level value="trace"/> | |
</logger> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.EhCacheProvider" /> | |
<property name="hibernate.cache.use_query_cache" value="true" /> | |
<property name="hibernate.cache.use_second_level_cache" value="true" /> | |
<!-- not used in this version 3.3 --> | |
<!-- <property name="hibernate.cache.provider_class" value="org.hibernate.cache.hibernate.EhCacheProvider" /> --> | |
<!-- <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory"/> |