Tranaction with KODO JCA and DAO

Hi,Abe,
I use KODO JCA with JBoss3.2.1.We encounter some problem with transaction.We use CMT(Container Management Transaction)provider by JBoss EJB container.
the seniario is:
public class SessBeanA iimplements SessionBean{
public void method(){
A a_new A();
a.method1();
B b_new B();
b.method2();
public class A{   _
method1(){
//use KODO jdo insert one record. _
public class B{
method2(){
//use DAO query the record insert.
method() inSessBeanA is configued use CMT and start new tranction when called.
We want to keep a.method1() and b.method2() in same transaction(method1() and method2() use transaction created by method()).but unfortunately,as they use different DB connection instance(one is from KODO JDO JCA,the other is from direct JDBC),they didn't keep in same transaction.so b.method2() can't find the record insert by a.method1() because method1() hasn't commit.
you know,as for complexity,we can't use only KODO for insert/query,we had to use other technology like DAO.Would you pls tell us how to keep KODO JDO call and our DAO call in same transaction?
Regards,
geduo

Consider getting a database connection from Kodo using JDBCStoreManager,
i.e.
KodoPersistenceManager.getStoreManager().getConnection() or
KodoPersistenceManager.getConnection() I think.
Then you'll get the same connection Kodo is using and hence the same
transaction associated with it.
Alex.
geduo wrote:
This is a multi-part message in MIME format.
------=_NextPart_000_001D_01C3CF8B.2D85C0D0
Content-Type: text/plain;
     charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Hi,Abe,
I use KODO JCA with JBoss3.2.1.We encounter some problem with =
transaction.We use CMT(Container Management Transaction)provider by =
JBoss EJB container.
the seniario is:
public class SessBeanA iimplements SessionBean{
public void method(){
A a=3Dnew A();
a.method1();
B b=3Dnew B();
b.method2();
public class A{   =20
method1(){
//use KODO jdo insert one record. =20
public class B{
method2(){
//use DAO query the record insert.
method() inSessBeanA is configued use CMT and start new tranction when =
called.
We want to keep a.method1() and b.method2() in same =
transaction(method1() and method2() use transaction created by =
method()).but unfortunately,as they use different DB connection =
instance(one is from KODO JDO JCA,the other is from direct JDBC),they =
didn't keep in same transaction.so b.method2() can't find the record =
insert by a.method1() because method1() hasn't commit.
you know,as for complexity,we can't use only KODO for insert/query,we =
had to use other technology like DAO.Would you pls tell us how to keep =
KODO JDO call and our DAO call in same transaction?
Regards,
geduo
------=_NextPart_000_001D_01C3CF8B.2D85C0D0
Content-Type: text/html;
     charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>
<DIV><FONT face=3DArial size=3D2>Hi,Abe,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I use KODO JCA with JBoss3.2.1.We =
encounter some=20
problem with transaction.We use CMT(Container Management =
Transaction)provider by=20
JBoss EJB container.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the seniario is:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>public class SessBeanA iimplements=20
SessionBean{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>    public void=20
method(){</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>        A =
a=3Dnew=20
A();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>       =20
a.method1();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>        B =
b=3Dnew=20
B();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>       =20
b.method2();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>    }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV></DIV>
<DIV><FONT face=3DArial size=3D2>public class A{    =
</FONT></DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>    =
method1(){</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>        =
//use KODO=20
jdo insert one record.    </FONT></DIV></DIV>
<DIV><FONT face=3DArial size=3D2>    }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>public class B{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>    =
method2(){</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>        =
//use DAO=20
query the record insert.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>    }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>method() inSessBeanA is configued =
use CMT and=20
start new tranction when called.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>We want to keep a.method1() and =
b.method2() in same=20
transaction(<STRONG>method1() and method2() use transaction =
created</STRONG>=20
<STRONG>by method()).</STRONG>but unfortunately,as they use different DB =
connection instance(one is from KODO JDO JCA,the other is from direct =
JDBC),they=20
didn't keep in same transaction.so b.method2() can't find the record =
insert by=20
a.method1() because method1() hasn't commit.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>you know,as for complexity,we can't use =
only KODO=20
for insert/query,we had to use other technology like DAO.Would you pls =
tell us=20
how to keep KODO JDO call and our DAO call in same =
transaction?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>geduo</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></DIV></BODY></HTML>
------=_NextPart_000_001D_01C3CF8B.2D85C0D0--

Similar Messages

  • Transaction problem with stateless EJB and DAO

    Hi,
    I'm using a stateless session bean with container managed transaction and I have a method, which updates a row via CMP entity bean and then calls stored procedure, using a DAO object, which has to use the updated data. Both calls must be done in one transaction. The problem is that the stored procedure doesn't see the changes made from the update via CMP EJB, but after the method exits the changes are in the database. I'm using WebSphere 4.0.3 and DB2 7.2. Method code example in the stateless bean:
    public doIt(ValueObject vo) throws ... {
    OrderPosRemote opr = getOrderPosRemote();
    opr.update(vo);
    getDAO().recalc(vo);
    } catch (DAOException daoex) {
    getSessionContext().setRollbackOnly();
    And in the DAO:
    public boolean recalc(...) throws DAOException {
    Connection conn = getConnFromDataSource();
    CallableStatement cstmt = conn.prepareCall("call ...(?,?)");
    cstmt.execute();
    ... // close cstmt and release connection to the pool
    Any help will be highly appreciated !

    Hi meadandale,
    this was my first guess too and I set this attribute in the session bean method, then into the update method of the CMP bean and "manually" to the connection object in the DAO like this:
    conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
    The isolation level is set correctly (IMHO), because when I comment the line above in the DAO, an exception is thrown stating that the isolation level can't be changed within a transaction.
    Unfortenully this didn't help too. Should I set some special attribute to the database or connection pool additionally ?
    I don't understand what is the problem actually - it is definitely one transaction and why this doesn't work is not very clear to me ...

  • GenerationType.AUTO doesn't work correctly with Kodo and MySQL

    Greetings,
    I'm migrating applications from JBoss/Hibernate to WebLogic/Kodo. The following column annotation:
    @Id
    @Column(name="CUSTOMER_ID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public long getCustomerId()
    is supposed to generate auto-increment primary key in mysql. This is what happens with Hibernate. With Kodo, this seems to be equivalent with GenerationType.TABLE as a table named openjpa_sequence_table is created, containing sequence values. So what should one do in order to be able to use true auto-increment strategy with MySQL and Kodo ?
    Many thanks in advance,
    Nicolas

    Hi Nicolas,
    By setting the generation strategy to AUTO, you're essentially letting the JPA provider choose which strategy to use. It looks like Kodo is using the TABLE strategy by default and Hibernate is using the IDENTITY strategy here. You can set the strategy to IDENTITY if you want Kodo to behave similarly to Hibernate. However, it's worth pointing out that there may be a reason for Kodo not using the IDENTITY strategy by default.
    The docs at: http://edocs.bea.com/wls/docs103/kodo/full/html/ref_guide_pc_oid.html#ref_guide_pc_oid_pkgen_autoinc
    point out the following:
    "Statements inserting into tables with auto-increment / identity columns cannot be batched. After each insert, Kodo must go back to the database to retrieve the last inserted auto-increment value to set back in the persistent object. This can have a negative impact on performance. "
    - Matt

  • How to deal with validation errors from DAO layer.

    I have been pondering on how to deal with validation errors from DAO layer.
    Lets say you have a DAO that can save a car object. A car has a year, make, model, vin and so on. During the save operation of this DAO, it validates the car attributes to see if they pass some business rules. If it does not it throws some validation exception that contains all the validation errors. These validation errors know nothing about jsf or my components it just knows what attributes on the object are invalid and why.
    If I just want to show those errors at the top of the page that would be no problem I could just create some FacesMessage objects and add them to the FacesContext messages. But if the DAO layer is telling me that the make attribute is invalid it would be nice to map it to the make field on the screen. I am wondering if any of you have tackled this problem or have some ideas on how to tackle it?
    Brian

    Let it throw an exception with a self explaining message, then catch it and embed that message in a FacesMessage.
    Or let it throw more specific exception types (InvalidCarMakeException extends CarDAOException and so on) and let JSF handle it with own FacesMessage message.

  • Error creating bean with name 'org.springframework.dao.annotation.Persisten

    Hello
    I am using Hibernate 4, Spring 3 , JSF 2.0 and Weblogic 10.3.6
    When I start weblogic server and server starts successfully, however whenever it starts publishing application, I am getting the following exception.
    Error creating bean with name
    'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0'
      defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
      Initialization of bean failed; nested exception is
      org.springframework.beans.factory.BeanCreationException:
        Caused By: org.springframework.beans.factory.BeanCreationException: Error creating
       bean with name 'entityManagerFactory'defined in ServletContext resource
       [/WEB-INF/applicationContext.xml]: Invocation of init method failed;
       nested exception is java.lang.NoSuchMethodError:
       javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/
       SharedCacheMode;
    Caused By: java.lang.NoSuchMethodError:
    javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()
    Ljavax/persistence /SharedCacheMode;    at
    org.hibernate.ejb.util.LogHelper.logPersistenceUnitInfo(LogHelper.java:38)  at
    org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:525)
    at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)     at  org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManager I have the following in applicationContext.xml
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd">     
        <context:component-scan base-package="net.test" />
        <!-- Data Source Declaration -->
        <bean id="DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
            destroy-method="close">
            <property name="driverClass" value="oracle.jdbc" />
            <property name="jdbcUrl" value="jdbc:oracle:thin:@server:1521:DB" />
            <property name="user" value="scott" />
            <property name="password" value="tiger" />
            <property name="maxPoolSize" value="10" />
            <property name="maxStatements" value="0" />
            <property name="minPoolSize" value="5" />
        </bean>
        <bean
            class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
        <!-- JPA Entity Manager Factory -->
        <bean id="entityManagerFactory"
            class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
            <property name="dataSource" ref="DataSource" />
            <property name="packagesToScan" value="net.test.entity" />
            <property name="jpaVendorAdapter">
                <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                    <property name="showSql" value="true" />
                    <property name="generateDdl" value="false" />
                    <property name="databasePlatform" value="${jdbc.dialectClass}" />
                </bean>
            </property>
        </bean>
        <bean id="defaultLobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" />
        <!-- Session Factory Declaration -->
        <bean id="SessionFactory"
            class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
            <property name="dataSource" ref="DataSource" />
            <property name="annotatedClasses">
                <list>
                    <value>net.test.entity.Department</value>
                    <value>net.test.entity.Employees</value>
                </list>
            </property>
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
                    <prop key="hibernate.show_sql">true</prop>
                    <prop key="hibernate.query.factory_class">org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory
                    </prop>
                </props>
            </property>
        </bean>
        <!-- Enable the configuration of transactional behavior based on annotations -->
        <tx:annotation-driven transaction-manager="txManager" />
        <tx:annotation-driven transaction-manager="transactionManager" />
        <!-- Transaction Config -->
        <bean id="txManager"
            class="org.springframework.orm.hibernate4.HibernateTransactionManager">
            <property name="sessionFactory" ref="SessionFactory" />
        </bean>
        <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
            <property name="entityManagerFactory" ref="entityManagerFactory" />
        </bean>
        <context:annotation-config />   
        <bean id="hibernateStatisticsMBean" class="org.hibernate.jmx.StatisticsService">
            <property name="statisticsEnabled" value="true" />
            <property name="sessionFactory" value="#{entityManagerFactory.sessionFactory}" />
        </bean>
        <bean name="ehCacheManagerMBean"
            class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" />
        <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
            <property name="locateExistingServerIfPossible" value="true" />
        </bean>   
        <bean id="jmxExporter" class="org.springframework.jmx.export.MBeanExporter"
            lazy-init="false">
            <property name="server" ref="mbeanServer" />
            <property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING" />
            <property name="beans">
                <map>
                    <entry key="SpringBeans:name=hibernateStatisticsMBean"
                        value-ref="hibernateStatisticsMBean" />
                    <entry key="SpringBeans:name=ehCacheManagerMBean" value-ref="ehCacheManagerMBean" />
                </map>
            </property>
        </bean>
    </beans>
    pom.xml
    <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/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>net.test</groupId>
        <artifactId>myappp</artifactId>
        <packaging>war</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>myappp</name>
        <url>http://maven.apache.org</url>
        <repositories>
            <repository>
                <id>prime-repo</id>
                <name>PrimeFaces Maven Repository</name>
                <url>http://repository.primefaces.org</url>
                <layout>default</layout>
            </repository>
        </repositories>
        <properties>
            <spring.version>3.1.1.RELEASE</spring.version>
        </properties>
        <dependencies>
            <!-- Spring 3 dependencies -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-orm</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <!-- JSF library -->
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>2.1.6</version>
            </dependency>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>2.1.6</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>jstl</artifactId>
                <version>1.2</version>
            </dependency>
            <!-- Primefaces library -->
            <dependency>
                <groupId>org.primefaces</groupId>
                <artifactId>primefaces</artifactId>
                <version>3.4.2</version>
            </dependency>
            <dependency>
                <groupId>org.primefaces.themes</groupId>
                <artifactId>afterwork</artifactId>
                <version>1.0.8</version>
            </dependency>
            <!-- Hibernate library -->
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>4.1.0.Final</version>
            </dependency>
            <dependency>
                <groupId>javassist</groupId>
                <artifactId>javassist</artifactId>
                <version>3.12.1.GA</version>
            </dependency>
            <dependency>
                <groupId>javax.inject</groupId>
                <artifactId>javax.inject</artifactId>
                <version>1</version>
            </dependency>
            <!-- Oracle Java Connector library -->
            <dependency>
                <groupId>com.oracle</groupId>
                <artifactId>ojdbc6</artifactId>
                <version>11.2.0.3</version>
            </dependency>
            <dependency>
                <groupId>c3p0</groupId>
                <artifactId>c3p0</artifactId>
                <version>0.9.1.2</version>
            </dependency>
            <!-- Log4j library -->
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.16</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.4</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-jpamodelgen</artifactId>
                <version>1.2.0.Final</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>4.1.0.Final</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate.javax.persistence</groupId>
                <artifactId>hibernate-jpa-2.0-api</artifactId>
                <version>1.0.1.Final</version>
            </dependency>
            <dependency>
        <groupId>org.apache.myfaces.extensions.cdi.core</groupId>
        <artifactId>myfaces-extcdi-core-api</artifactId>
        <version>1.0.5</version>
        <scope>compile</scope>
    </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-ehcache</artifactId>
                <version>4.0.1.Final</version>
            </dependency>      
        </dependencies>
        <build>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>             
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                        <compilerArgument>-proc:none</compilerArgument>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.bsc.maven</groupId>
                    <artifactId>maven-processor-plugin</artifactId>
                    <version>2.0.6</version>
                    <executions>
                        <execution>
                            <id>process</id>
                            <goals>
                                <goal>process</goal>
                            </goals>
                            <phase>generate-sources</phase>
                            <configuration>
                                <!-- source output directory -->
                                <outputDirectory>target/metamodel</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>In Weblogic 10.3.6 I have enabled JPA2 support by adding the following in commEnv.cmd
    @rem Enable JPA 2.0 functionality on WebLogic Server
    set PRE_CLASSPATH=%BEA_HOME%\modules\javax.persistence_1.1.0.0_2-0.jar;
    %BEA_HOME%\modules\com.oracle.jpa2support_1.0.0.0_2-1.jarApplication which works on WLS 10.3.6 is http://download.oracle.com/otn/nt/middleware/11g/wls/1036/wls1036_dev.zip and the one which is not working is
    http://download.oracle.com/otn/nt/middleware/11g/wls/1036/wls1036_win32.exe.
    How can I resolve these errors and exceptions? Any help is highly appreciable.
    Thanks

    Looks like you might have a spelling error in your spring config, or are trying to set a read-only property. BdasInterfaceManagerImpl has been configured as having a method called setBdasInterfaceJdbcDao() : does it?
    By the way, we now know that you're writing code for JP Morgan - there's a slight risk that this could bite you in the @ss at some point (there are some malicious people around) you might want to take that into consideration next time!

  • JSP, BEANS AND DAO best practice... (and a little of STRUTS & JSTL)

    Hi,
    Want to get your opinion on how to really use bean and dao in jsp pages.
    Imagine that you wants to display a news list on the jsp index page for example.
    You've got a dao with method getLastNews(int size) which returns a Collection of News beans. Then with jstl or struts you iterate ove the collection to display the news in a formatted way.
    Easy to build collection with scriptlets & co but not very clean...
    What is the best way to call my dao and its method with a tag whithout using scriplets ?
    Thanks

    Yes this is the solution i use when the collection is displayed alone in a jsp page, but how do you do this when you include this collection in a page, and if you have other collections in other parts of the page ? Is there a clean solution of doing this in the jsp page? For example:
    <sometag:loadmycollection name="list"/>
    <logic:iterate id="myCollectionElement" name="list">
    Element Value: <bean:write name="myCollectionElement" />
    </logic:iterate>
    I know that i can write my own tag by if there is an existing solution...

  • Using Tangosol Coherence in conjunction with Kodo JDO for distributing caching

    JDO currently has a perception problem in terms of performance. Transparent
    persistence is perceived to have a significant performance overhead compared
    to hand-coded JDBC. That was certainly true a while ago, when the first JDO
    implementations were evaluated. They typically performed about half as well
    and with higher resource requirements. No doubt JDO vendors have closed that
    gap by caching PreparedStatements, queries, data, and by using other
    optimizations.
    Aside from the ease of programming through transparent persistence, I
    believe that using JDO in conjunction with distributed caching techniques in
    a J2EE managed environment has the opportunity to transparently give
    scalability, performance, and availability improvements that would otherwise
    be much more difficult to realize through other persistence techniques.
    In particular, it looks like Tangosol is doing a lot of good work in the
    area of distributed caching for J2EE. For example, executing parallelized
    searches in a cluster is a capability that is pretty unique and potentially
    very valuable to many applications. It would appear to me to be a lot of
    synergy between Kodo JDO and Tangosol Coherence. Using Coherence as an
    implementation of Kodo JDO's distributed cache would be a natural desire for
    enterprise applications that have J2EE clustering requirements for high
    scalability, performance, and availability.
    I'm wondering if Solarmetric has any ideas or plans for closer integration
    (e.g., pluggability) of Tangosol Coherence into Kodo JDO. This is just my
    personal opinion, but I think a partnership between your two organizations
    to do this integration would be mutually advantageous, and it would
    potentially be very attractive to your customers.
    Ben

    Marc,
    Thanks for pointing that out. That is truly excellent!
    Ben
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Ben-
    We do currently have a plug-in for backing our data cache with a
    Tangosol cache.
    See: http://docs.solarmetric.com/manual.html#datastore_cache_config
    In article <[email protected]>, Ben Eng wrote:
    JDO currently has a perception problem in terms of performance.
    Transparent
    persistence is perceived to have a significant performance overheadcompared
    to hand-coded JDBC. That was certainly true a while ago, when the firstJDO
    implementations were evaluated. They typically performed about half aswell
    and with higher resource requirements. No doubt JDO vendors have closedthat
    gap by caching PreparedStatements, queries, data, and by using other
    optimizations.
    Aside from the ease of programming through transparent persistence, I
    believe that using JDO in conjunction with distributed cachingtechniques in
    a J2EE managed environment has the opportunity to transparently give
    scalability, performance, and availability improvements that wouldotherwise
    be much more difficult to realize through other persistence techniques.
    In particular, it looks like Tangosol is doing a lot of good work in the
    area of distributed caching for J2EE. For example, executingparallelized
    searches in a cluster is a capability that is pretty unique andpotentially
    very valuable to many applications. It would appear to me to be a lot of
    synergy between Kodo JDO and Tangosol Coherence. Using Coherence as an
    implementation of Kodo JDO's distributed cache would be a natural desirefor
    enterprise applications that have J2EE clustering requirements for high
    scalability, performance, and availability.
    I'm wondering if Solarmetric has any ideas or plans for closerintegration
    (e.g., pluggability) of Tangosol Coherence into Kodo JDO. This is justmy
    personal opinion, but I think a partnership between your twoorganizations
    to do this integration would be mutually advantageous, and it would
    potentially be very attractive to your customers.
    Ben--
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • How can I use the ScrollTablePane with kodo ?

    How can I use the ScrollTablePane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.

    Marco-
    I am not familiar with any "TableScrollPane" classes. Can you clarify
    whether this is some 3rd party custom component, or something you have
    written?
    Note that we do not provide any pre-build graphical data components with
    Kodo, but we do intend to provide some examples in the future.
    In article <cl1hn7$9ep$[email protected]>, Marco Aurelio Bueno wrote:
    >
    How can I use the TableScrollPane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.--
    Marc Prud'hommeaux
    SolarMetric Inc.

  • How can I use the TableScrollPane with kodo

    How can I use the TableScrollPane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.

    Marco-
    I am not familiar with any "TableScrollPane" classes. Can you clarify
    whether this is some 3rd party custom component, or something you have
    written?
    Note that we do not provide any pre-build graphical data components with
    Kodo, but we do intend to provide some examples in the future.
    In article <cl1hn7$9ep$[email protected]>, Marco Aurelio Bueno wrote:
    >
    How can I use the TableScrollPane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.--
    Marc Prud'hommeaux
    SolarMetric Inc.

  • BO and DAO coupling

    My patterns aren't the strongest, so I'm looking for a little help here.
    BO - Business Object
    DAO - Data Access Object
    TO - Transfer Object
    I'm writing a web app, and I have a set of BO's that need to be persisted. Everything I read says that I should have a TO to pass to the DAO, but I don't see the point of that. I realize that it's supposed to be decoupled and all, but if I can make the assumption that, realistically, I'm only going to use this set of BO's with this set of DAO's, is there a point to using TO's? It just seems like an extra layer that is going to wind up being pointless. I'd rather just pass the BO to the DAO for the CRUD stuff.
    Can someone please show me some reasons that I shouldn't do it this way? I don't want to be 6 months into this and say, damn, I wish I used TO's.
    Thanks in advance.

    It would probably depend a lot on how many objects there are and how complex they are.
    Is this project going to be finished in two weeks and done by a single person? And it grow less than 10% a year. If yes then do whatever is easiest. The overhead of figuring out any application for a maintainance programmer will be far more than understanding the code. And extra layers will just complicate it.
    On the other hand if it is going to take 6 months and 3-5 developers are working on it with two new revisions already in the works, then seperating it is probably going to be very cost effective.

  • Recent Kodo versions and WebSphere 4.0

    Hi,
    we may have to use WebSphere 4.0 with Kodo until the IT infrastructure
    department supports the latest version WebSphere 5.0.
    Is anyone still developing with Kodo and WebSphere 4.0? Can I use Kodo
    2.5 / 3.0 with the 'old' version of WebSphere?
    Thanks a lot!
    Yours,
    Carsten

    Carsten-
    Our only feedback is that Kodo has not been tested with Websphere
    versions before 5.0.
    Note that you can always just Kodo directly: the only hiccup might be in
    the automatic global transaction synchronization. As long as Websphere
    4.0 provides a JTA-compliant TransactionManager, though, you might be
    able to solve any problems you see by writing a custom ManagedRuntime
    implementation.
    I'm sure the rest of the community will be interested in hearing the
    results of your tests.
    In article <bn38qa$d1i$[email protected]>, Carsten Jahn wrote:
    Hi,
    we may have to use WebSphere 4.0 with Kodo until the IT infrastructure
    department supports the latest version WebSphere 5.0.
    Is anyone still developing with Kodo and WebSphere 4.0? Can I use Kodo
    2.5 / 3.0 with the 'old' version of WebSphere?
    Thanks a lot!
    Yours,
    Carsten
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Generating the .CAP, .JCA and .EXP files.

    Hello;
    I have downloaded the java_card_kit-2_1_2 to &lsquo;C:\java_card_kit-2_2_1", and I tried to compile HelloWorld application that shipped with its distribution. I was successfully able to compile the file HelloWorld.java, but I am having lots of problems in generating the .CAP, .JCA and .EXP files.
    I tried to follow the instructions in jcdk2.2.1 user guide, but of no use.
    This is what I am basically doing:
    _Step1) Setting my Environment Variables as follows:_
    *set JC_HOME=C:\java_card_kit-2_2_1*
    *set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_16*
    *set PATH=.;%JC_HOME%\bin;%JAVA_HOME%\bin;%PATH%*
    _Step2) Compile the java file_
    The package of HelloWorld.java is : src.com.sun.javacard.samples.HelloWorld, so to compile I use the following command line:
    *javac -g -target 1.1 -source 1.3 -classpath .\classes;..\lib\api.jar;..\lib\installer.jar src\com\sun\javacard\samples\HelloWorld\*.java*
    _Step3) Converting_
    I have the class file generated in the package folder: src.com.sun.javacard.samples.HelloWorld, I generated an .opt file as follows:
    +-out EXP JCA CAP+
    +-exportpath .+
    +-debug+
    +-applet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1:0x1 src.com.sun.javacard.samples.HelloWorld.HelloWorld+
    +src.com.sun.javacard.samples.HelloWorld 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1 1.0+
    Finally, the command line for conversion is:
    *set _CLASSES=%JC_HOME%\lib\apduio.jar;%JC_HOME%\lib\apdutool.jar;%JC_HOME%\lib\jcwde.jar;%JC_HOME%\lib\converter.jar;%JC_HOME%\lib\scriptgen.jar;%JC_HOME%\lib\offcardverifier.jar;%JC_HOME%\lib\api.jar;%JC_HOME%\lib\installer.jar;%JC_HOME%\lib\capdump.jar;%JC_HOME%\samples\classes;%CLASSPATH%;*
    *"%JAVA_HOME%\bin\java" -classpath %_CLASSES% com.sun.javacard.converter.Converter -config src\com\sun\javacard\samples\HelloWorld\HelloWorld.opt*
    After successfully executing all these lines, I get the following error:
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    *+error: class HelloWorld does not belong to package src.com.sun.javacard.samples.HelloWorld.+*
    conversion completed with 1 errors and 0 warnings.
    PLEASE HELP! I also tried adding -classdir to the opt file, but still did not work.
    The whole point behind this exercise is to import a javacard framework of version 1.0
    Really appreciate anyone's help! Thanks in advance.

    Thank you Shane, but my claSs file is indeed saved in "C:\java_card_kit-2_2_1\samples\src\com\sun\javacard\samples\HelloWorld"
    Now since I am running my command lines from C:\java_card_kit-2_2_1\samples, so I guess that the class directory is:
    src.com.sun.javacard.samples.HelloWorld
    Right?

  • What's the Best Open Source DB for use with Kodo?

    Hi everyone,
    In terms of ease of setup and use, tools to view info in the database, and least difficulty in
    running with Kodo, what is the best open source database to use? I'm use to using Oracle and
    SQLPlus. I need to use an open source DB for a learning environment, and I'd like your informed
    opinion.
    Thanks,
    David Ezzio

    I have been using postgresql 7.1 with Kodo for a while with mostly positive results, and currently
    have it deployed with Kodo 2.2.3. I prefer it to mysql because its feature set is a little richer,
    and supports transactions natively. My experience with mysql (without jdo - I haven't tried it with)
    is good, but there were little things missing in mysql 3.x, e.g. the ability do do a join in a
    DELETE statement.
    BTW, there are some severe problems somewhere in the 2.2.4 release with postgresql if you intend to
    eventually deploy on it. It also apparently has some problems invoking postgresql's indices, making
    it a little less than optimal. But as a learning environment, it's what I'd recommend.
    -Mike
    Marc Prud'hommeaux wrote:
    David-
    Here is the rundown of the databases I have experience with:
    MySQL: Fairly simple to install (especially if you run Debian Linux), but
    configuration, especially adding users, can be a pain. A separate open
    source project called "mysql-navigator" makes it fairly easy to do
    simple queries, inserts, etc. In most of my tests it outperforms
    PostgreSQL, but your mileage will vary. It has a sane CLI that supports
    modern features like line history, etc (unlike the horrific SQLPlus).
    PostgreSQL: People often say that it is a more "academically
    correct" database than MySQL. I've also found it to be quite a bit
    easier to set up. Their GUI (called "pgaccess") is simplistic, but does
    most things you need. Has a CLI similiar to MySQL's.
    HypersonicSQL: By far the easiest to set up (just drop the jar in your
    CLASSPATH), but is java only, can be rather slow, and has no GUI tools
    available that I know of (except various free vanilla-JDBC GUI tools).
    We feel that Kodo works quite well with all these DBs. The MySQL JDBC
    driver seems a bit less buggy than Postgres', but their transaction
    support is very recent and not very well tested. If I had to pick one or
    the other, I would probably go with MySQL.
    David Ezzio <[email protected]> wrote:
    Hi everyone,
    In terms of ease of setup and use, tools to view info in the database, and least difficulty in
    running with Kodo, what is the best open source database to use? I'm use to using Oracle and
    SQLPlus. I need to use an open source DB for a learning environment, and I'd like your informed
    opinion.
    Thanks,
    David Ezzio--
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Kodo Java Data Objects Full featured JDO: eliminate the SQL from your code--
    Mike Bridge

  • Kodo, JRun, and logging

    Hi,
    I'm trying to run my Kodo JDO application in a JRun4 J2EE server. I'm
    having a problem getting logging to work, and I've discovered what's
    happening.
    As it happens, JRun is using the commons logging facility itself, and
    initializes an older version of Log4j before my classes are even loaded.
    Thus, any log4j.properties file I specify (or even if I change the name to
    something else and specify it via the log4j.configuration system property)
    is ignored because by the time the web app is loaded, the system
    log4j.properties have already been initialized and mine are ignored.
    The solution offered on the JRun support site is to rewrite your
    log4j-enabled app to use custom logging (in a JRun-proprietary format),
    but that's obviously not an option for me here because the logging is
    internal to Kodo's classes.
    What I'm wondering is this: is there a setting I can specify something in
    my kodo.properties file or in some other location that will tell Kodo to
    instantiate its own private log4j instance instead of using the system's?
    Or is there some other way to force Kodo to ignore the existing JRun
    logging facility?
    Any thoughts would be much appreciated.
    Thanks,
    Bill

    Oops! The my posting didn't get put up exactly as I typed it. Instances of
    "$/servers/lib" should instead be "JRUN_HOME/servers/lib" where
    "JRUN_HOME" is the directory that JRun is installed in.
    Bill
    William Korb wrote:
    Marc,
    Thanks for the feedback. I experimented a bit (quite a bit, actually) and
    found a configuration that works without having to implement a custom
    logging mechanism.
    First off, in order to use the version of Log4j that came with Kodo
    instead of the old version that is bundled with JRun (and embedded in one
    of JRun's own JAR files, BTW - ick!), I had to make a couple of JRun
    configuration changes.
    1. Install log4j-1.2.6.jar in $/servers/lib
    2. Install log4j.properties in $/servers/lib
    3. Create a .../WEB-INF/jrun-web.xml file with the following contents:
    <?xml version ="1.0"?>
    <!DOCTYPE jrun-web-app SYSTEM "jrun-web.dtd">
    <jrun-web-app>
    <load-system-classes-first>false</load-system-classes-first>
    </jrun-web-app>
    This last step is the critical one - it tells JRun to put
    $/servers/lib in the CLASSPATH ahead of the JRun system jars
    (which include the old version of Log4j, etc.).
    The down-side of this configuration is that every JRun server instance
    will use the same Log4j setup, but I can live with that.
    Lastly, I tweaked the log4j.properties file to send my Kodo log entries
    into a separate file (otherwise they ended up intermingled with the
    standard JRun log entries):
    # Normal Kodo logging configuration
    log4j.rootCategory=INFO, console
    # Custom verbosity levels on a per-category basis
    log4j.category.com.solarmetric.kodo.impl.jdbc.SQL=DEBUG, kodolog
    log4j.category.com.solarmetric.kodo.impl.jdbc.JDBC=INFO, kodolog
    log4j.category.com.solarmetric.kodo.impl.jdbc.Schema=INFO, kodolog
    log4j.category.com.solarmetric.kodo.Performance=INFO, kodolog
    log4j.category.com.solarmetric.kodo.MetaData=INFO, kodolog
    log4j.category.com.solarmetric.kodo.Enhance=INFO, kodolog
    log4j.category.com.solarmetric.kodo.Query=DEBUG, kodolog
    log4j.category.com.solarmetric.kodo.Runtime=DEBUG, kodolog
    # Set appender specific options.
    log4j.appender.kodolog=org.apache.log4j.RollingFileAppender
    log4j.appender.kodolog.File=/tmp/javatest-kodo.log
    log4j.appender.kodolog.Append=true
    log4j.appender.kodolog.MaxFileSize=10mb
    log4j.appender.kodolog.MaxBackupIndex=9
    log4j.appender.kodolog.layout=org.apache.log4j.PatternLayout
    log4j.appender.kodolog.layout.ConversionPattern=%-5r %-5p [%t] %c - %m%n
    log4j.appender.console=org.apache.log4j.ConsoleAppender
    log4j.appender.console.layout=org.apache.log4j.PatternLayout
    log4j.appender.console.layout.ConversionPattern=%-5r %-5p [%t] %c - %m%n
    If Macromedia ever gets around to putting out another release of JRun,
    hopefully they'll address these poor design decisions.
    Bill
    Marc Prud'hommeaux wrote:
    Bill-
    I assume that you don't have access to JRun's log4j properties file so
    you can use it to set the Kodo logging parameters.
    You might be able to coerce JRun into using some logger of your own
    devising with the "org.apache.commons.logging.LogFactory" system
    property. E.g., see:>>
    >
    http://www.solarmetric.com/Software/Documentation/3.0.0RC4/docs/manual.html#ref_guide_logging_custom
    There is currently no way to tell Kodo to use a separate logger on it's
    own: you will need to do it via the commons logging framework.
    Let us know if we can offer some more suggestions, if this one doesn't
    work.
    In article <[email protected]>, William Korb wrote:
    Hi,
    I'm trying to run my Kodo JDO application in a JRun4 J2EE server. I'm
    having a problem getting logging to work, and I've discovered what's
    happening.
    As it happens, JRun is using the commons logging facility itself, and
    initializes an older version of Log4j before my classes are even loaded.
    Thus, any log4j.properties file I specify (or even if I change the name
    to
    something else and specify it via the log4j.configuration systemproperty)
    is ignored because by the time the web app is loaded, the system
    log4j.properties have already been initialized and mine are ignored.
    The solution offered on the JRun support site is to rewrite your
    log4j-enabled app to use custom logging (in a JRun-proprietary format),
    but that's obviously not an option for me here because the logging is
    internal to Kodo's classes.
    What I'm wondering is this: is there a setting I can specify something in
    my kodo.properties file or in some other location that will tell Kodo to
    instantiate its own private log4j instance instead of using the system's?
    Or is there some other way to force Kodo to ignore the existing JRun
    logging facility?
    Any thoughts would be much appreciated.
    Thanks,
    Bill
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Difference between JCA and Jco.

    Hi Guys,
    I am a little confused between JCA and JCo, I am currently working with SAP Portal 6.0 according to its specifications JCo is a depricated and suggests the usage of JCA. On the other hand when I was reading about connecting to an SAP system using java, it suggests the usage of JCo. My knowledge with regard to JCo is limited, so I was wondering if anyone could throw some light here as to what is the difference in using either of them or rather which is the prefered way about going about it.
    Thanks in advance..
    Rajitha

    I think lancea is definitely on the right track.
    Jco is typically described as the way to use SAP from Java code and to use Java code from SAP. It is a specific API for allowing SAP and external Java code to call each other.
    JCA (J2EE Connector Architecture) is a general-purpose archiecture and API for allowing external systems and J2EE apps running in an app server to work together. To get a J2EE app working with SAP would require the use of an SAP connector, written to the JCA specs. More than likely, such a connector would itself use Jco. But the J2EE application code would use the connector, not the Jco code directly.
    I hope that helps.
    - Tim (Sun Microsystems)

Maybe you are looking for

  • Anti virus

    I own Bb Curve 8520. Does it come with antivirus installed? Or do I have to install one and if so, please advise. Solved! Go to Solution.

  • Front Row on mac mini: We need some fixes

    Been having fun playing with my mac mini and trying it out as a home media center, to network and play all my shared media that's on my iMac G5 and enjoy it on my 32" LCD TV and stereo system. There are three major glitches that keep this from workin

  • Vendor configuration

    Hi My client is askint to run APP(automatic Payment) the vendor is in both local and foreign vendor( same vendor name both in local and foreign) where do we configure in vendor master? why the system is taking only local vendors in APP run My client

  • User Problem in CCM

    Hi Gurus, When the user goes to the punchout site and try to create a shopping cart from the vendor's website, he sees the other user shopping list also.But the user has to see his own shopping list, not any other user shopping list in the vendor's w

  • MPs at second level of BOM

    Hi, I have a header material A-MRP type -PD. independent requirements maintined in MD61 for 25 qty. I have a bom compoennet B directly below A -MRP type -M1. Now when multilevel MRP is run for A using MD02 , i  see no dependent requirements are gener