<<上篇 | 首页 | 下篇>>

设置ear中war之间session共享 - gaohaiyang的专栏 - 博客频道 - CSDN.NET

设置ear中war之间session共享

由J2EE Servlet规范中,可以知道,正常情况下war之间session是彼此独立的,不可以共享的。
但是现在大部分J2EE服务器,都实现了EAR中war之间的session共享,如weblogic(>=9)、websphere。

设置weblogic的EAR中war之间session共享有下面两种方法:

1:设置EAR中的weblogic-application.xml文件,加入如下片段:

    <wls:session-descriptor>
  <wls:persistent-store-type>memory</wls:persistent-store-type>
  <wls:sharing-enabled>true</wls:sharing-enabled>
 </wls:session-descriptor>
 
整个weblogic-application.xml内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/90http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
    <wls:weblogic-version>10.0</wls:weblogic-version>
    <wls:context-root>testEARweb2</wls:context-root>
    <wls:session-descriptor>
  <wls:persistent-store-type>memory</wls:persistent-store-type>
  <wls:sharing-enabled>true</wls:sharing-enabled>
 </wls:session-descriptor>

</wls:weblogic-web-app>

2.设置需要共享session的war内的weblogic.xml文件,例如testEAR内有两个war,testEARweb1和testEARweb2,想让这两个war之间session共享,
则需要设置这两个war里面的weblogic.xml文件,同样,加入下面片段即可:
    <wls:session-descriptor>
  <wls:persistent-store-type>memory</wls:persistent-store-type>
  <wls:sharing-enabled>true</wls:sharing-enabled>
 </wls:session-descriptor>
设置后testEARweb1的weblogic.xml内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/90http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
    <wls:weblogic-version>10.0</wls:weblogic-version>
    <wls:context-root>testEARweb1</wls:context-root>
    <wls:session-descriptor>
  <wls:persistent-store-type>memory</wls:persistent-store-type>
  <wls:sharing-enabled>true</wls:sharing-enabled>
 </wls:session-descriptor>

</wls:weblogic-web-app>
 
testEARweb2的weblogic.xml内容如下: 
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/90http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
    <wls:weblogic-version>10.0</wls:weblogic-version>
    <wls:context-root>testEARweb2</wls:context-root>
    <wls:session-descriptor>
  <wls:persistent-store-type>memory</wls:persistent-store-type>
  <wls:sharing-enabled>true</wls:sharing-enabled>
 </wls:session-descriptor>
</wls:weblogic-web-app>

这样,EAR内的war之间就可以共享session了。

对于WAS,需要设置ibm-application-ext.xmi文件,

<applicationext:ApplicationExtension xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:applicationext="applicationext.xmi" xmlns:application="application.xmi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:id="Application_ID_Ext" sharedSessionContext="true"> 

其中sharedSessionContext="true",就是说明要开启共享session。

阅读全文……

标签 : ,

BIRT report viewer IE11 上预览不正常工作 及汉化

BIRT report viewer 在IE11上使用View Report In Web Viewer 是不能正常工作的,有两种办法:

1、删掉IE11

2、修改Eclipse.ini 增加

      -Dorg.eclipse.swt.browser.DefaultType=mozilla

 

汉化包下载BabelLanguagePack-birt-zh_3.7.0.v20130724081219.zip

http://archive.eclipse.org/technology/babel/babel_language_packs/R0.11.0/indigo/indigo.php

解压覆盖features和plugins目录

标签 : , ,

How to benchmark BIRT report performance? - Stack Overflow

总结一下,大概有几点:

SQL执行计划,SQL跟踪调优

减少报表需要处理的数据,大量数据分页是不合适的

保持报表简洁,去掉无用的表格、图表

减少使用脚本,和数据源关联的脚本

For anyone else having problems with BIRT performance, here are a few more hints.

  • Profiling a BIRT report can be done using any Java profiler - write a simple Java test that runs your report and then profile that. As an example I use the unit tests from the SpudSoft BIRT Excel Emitters and run JProfiler from within Eclipse. The problem isn't with the difficulty in profiling it, it's in understanding the data produced :)

  • Scripts associated with DataSources can absolutely kill performance. Even a script that looks as though it should only have an impact up-front can really stop this thing. This is the biggest performance killer I've found (so big I rewrote quite a chunk of the Excel Emitters to make it unnecessary).

  • The emitter you use has an impact. If you are trying to narrow down performance problems always do separate Run and Render tasks so you can easily see where to concentrate your efforts.

  • Different emitter options can impact performance, particularly with the third party emitters (the SpudSoft emitters now have a few options for making large reports faster).

  • The difference between Fixed-Layout and Auto-Layout is significant, try both.

As I write this answer the question is getting close to 2 years old, so presumably you found a way around the problem. No one has offered a profiler for the entire process, so here are some ways of identifying bottle necks.

  1. Start up time - About a minute can be spent here

    • running a couple reports one after the other or starting a second after the first is running can help diagnosis issues.
  2. SQL Query run time - Good solutions are mentioned in the question

    • any SQL trace and performance testing will identify issues.
  3. Building the report - This is where I notice the lions share of time being taken. Run a SQL trace while the report is being created. Even a relatively simple tables with lots of data can take around a minute to configure and display (HTML via apache tomcat) after the SQL trace indicates the query is done.

    • simplify the report or create a clone with fewer graphs or tables run with and without pieces to see if any create a notable difference
    • modify the query to bring back less records, less records are easier to display,
  4. Delivery method PDF, Excel, HTML each can have different issues

    • try the report to different formats
    • if one is significantly greater, try different emitters.

 

阅读全文……

标签 : ,