Newsgroup: it.comp.java
Titolo: problema con EJB e ACL su driver JDBC (x andrea musumeci)

 wrote in message
news:TacK7.129530$sq5.6...@news.infostrada.it...
OK... ho capito quello che vuoi dire... allora includo tutti e tre gli xml e
i settings nel weblogic.properties..
Ti ringrazio in anticipo per il tempo che mi dedicherai!
Come puoi vedere il pool mypool č settato per accettare anche connessioni
di guest... nel caso in cui tolgo questo utente il mio bean Counter non
riesce
piů a collegarsi al db e in partenza mi da un errore!
------------------------weblogic.properties------------------------
weblogic.jdbc.connectionPool.mypool=\
        url=jdbc:oracle:thin:@xxx.x.x.x:1521:DB,\
        driver=oracle.jdbc.driver.OracleDriver,\
        loginDelaySecs=0,\
        maxCapacity=30,\
        capacityIncrement=1,\
        initialCapacity=1,\
        allowShrinking=true,\
        refreshMinutes=5,\
        shrinkPeriodMins=5,\
        testTable=dual,\
        props=user=usr;password=pwd
weblogic.jdbc.TXDataSource.weblogic.jdbc.jts.mypool=mypool
weblogic.allow.reserve.weblogic.jdbc.connectionPool.mypool=\
      guest,startup,beanCounter
weblogic.allow.reset.weblogic.jdbc.connectionPool.mypool=\
      guest,startup,beanCounter
weblogic.allow.shrink.weblogic.jdbc.connectionPool.mypool=\
      guest,startup,beanCounter
#aggiungo gli utenti
  weblogic.password.startup=startupPwd
  weblogic.password.beanCounter=beanCounterPwd
--------------------fine weblogic.properties-----------------------
------------------------ejb-jar.xml------------------------
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
JavaBeans 1.1//EN' '
http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd
'>
<ejb-jar>
    <enterprise-beans>
      <entity>
 <ejb-name>CounterHome</ejb-name>
 <home>CounterHome</home>
 <remote>Counter</remote>
 <ejb-class>CounterBean</ejb-class>
 <persistence-type>Container</persistence-type>
 <prim-key-class>CounterPK</prim-key-class>
 <reentrant>False</reentrant>
 <cmp-field>
   <field-name>valore</field-name>
 </cmp-field>
 <cmp-field>
   <field-name>tabella</field-name>
 </cmp-field>
      </entity>
    </enterprise-beans>
    <assembly-descriptor>
      <container-transaction>
 <method>
   <ejb-name>CounterHome</ejb-name>
   <method-intf>Remote</method-intf>
   <method-name>*</method-name>
 </method>
 <trans-attribute>Required</trans-attribute>
      </container-transaction>
    </assembly-descriptor>
  </ejb-jar>
--------------------fine ejb-jar.xml-----------------------
------------------------weblogic-cmp-rdbms-jar.xml------------------------
<!DOCTYPE weblogic-rdbms-bean PUBLIC
 "-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS Persistence//EN"
 "
http://www.bea.com/servers/wls510/dtd/weblogic-rdbms-persistence.dtd
">
<weblogic-rdbms-bean>
  <pool-name>mypool</pool-name>
  <table-name>contatore</table-name>
  <attribute-map>
    <object-link>
      <bean-field>valore</bean-field>
      <dbms-column>id</dbms-column>
    </object-link>
    <object-link>
      <bean-field>tabella</bean-field>
      <dbms-column>tabella</dbms-column>
    </object-link>
  </attribute-map>
  <finder-list>
      <finder>
       <method-name>findByTabella</method-name>
       <method-params>
         <method-param>int</method-param>
       </method-params>
       <finder-query><![CDATA[(= tabella $0)]]></finder-query>
     </finder>
  </finder-list>
  <options>
    <use-quoted-names>false</use-quoted-names>
    <transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation>
  </options>
</weblogic-rdbms-bean>
--------------------fine weblogic-cmp-rdbms-jar.xml-----------------------
------------------------weblogic-ejb-jar.xml------------------------
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0
EJB//EN' '
http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd
'>
<weblogic-ejb-jar>
    <weblogic-enterprise-bean>
      <ejb-name>CounterHome</ejb-name>
      <persistence-descriptor>
 <delay-updates-until-end-of-tx>false</delay-updates-until-end-of-tx>
 <persistence-type>
   <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
   <type-version>5.1.0</type-version>
   <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
 </persistence-type>
 <db-is-shared>true</db-is-shared>
 <persistence-use>
   <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
   <type-version>5.1.0</type-version>
 </persistence-use>
      </persistence-descriptor>
      <jndi-name>CounterHome</jndi-name>
    </weblogic-enterprise-bean>
  </weblogic-ejb-jar>
--------------------fine weblogic-ejb-jar.xml-----------------------


Nella mia esperienza no :-)
Non sono molto piu' veloci dei thin (almeno per cio' che riguarda i benchmark effettuati
sul nostro sistema) e sono molto, molto piu' problematici da manutenere a fronte di
variazioni dell'ambiente. Noi pero' non usavamo una piattaforma J2EE, e quindi puo' darsi
che in questo ambiente siano effettivamente piu' efficaci.
Ciao,
    Bruno.


|
| Bruno Bossola
| A Java Software Engineer :-)
| 
http://bbruno.fasturl.it
|
| 
http://members.xoom.it/bbruno
| 
http://digilander.iol.it/bbossola
|