Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. t0 = start action ;t1= action find and merge entity; t2= start call to web service; t6= web service return; tend = end action ;
  2. t3= start second process ; t4= find and merge entity; t5=end second process
  3.  
  4. t0 t1 t2 t3 t4 t5 t6 tend
  5.  
  6. |---------------|--------|------------------------------|-------|
  7.  
  8. |-----|----|
  9.  
  10. <?xml version="1.0" encoding="UTF-8"?>
  11. <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  12. <persistence-unit name="ApplicationWeb_EJB" transaction-type="JTA">
  13. <provider>org.hibernate.ejb.HibernatePersistence</provider>
  14. <jta-data-source>java:/ds/VisiaIntegrazioneDS</jta-data-source>
  15. <class>.....entity.ApplicationServer</class>
  16. ....
  17. <class>.....entity.Devices</class>
  18. <exclude-unlisted-classes>false</exclude-unlisted-classes>
  19. <properties>
  20. <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
  21. <!-- Caching properties -->
  22. <property name="hibernate.cache.use_second_level_cache" value="true"/>
  23. <!--<property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.SingletonEhCacheProvider" />-->
  24. <property name="net.sf.ehcache.configurationResourceName" value="ehcache.xml"/>
  25. <!--<property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>-->
  26. <!--<property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider" />-->
  27. <property name="hibernate.cache.use_query_cache" value="true"/>
  28. <property name="hibernate.cache.region.factory_class" value="net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory"/>
  29. <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
  30. <property name="hibernate.max_fetch_depth" value="4"/>
  31. <!-- hibernate.generate_statistics a true produce informazioni su hibernate da loggare -->
  32. <property name="hibernate.generate_statistics" value="true"/>
  33.  
  34. </properties>
  35. </persistence-unit>
  36. </persistence>
  37.  
  38. EntityManager em = EntityMan.getEMF().createEntityManager();
  39.  
  40. try {
  41.  
  42. em.find(Devices.class, device.getId());
  43. em.merge(device);
  44. em.flush();
  45. } catch (Exception e) {
  46. logger.debug(e.getMessage());
  47. e.printStackTrace();
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement