Resolved !
Migrated to the WebLogic 11, and changed the EclipseLink persistence provider to prove that support for 2.1 Lazy and transactions outside the EJB container.
Minimum configuration, good.
following configuration:
web.xml
persistence.xmlCode:<filter> <filter-name>openEntityManagerInViewFilter</filter-name> <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class> </filter> <filter-mapping> <filter-name>openEntityManagerInViewFilter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:org/springmvc/resources/spring-context.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>springmvcdispatcherservlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:org/springmvc/resources/spring-mvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springmvcdispatcherservlet</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping>
spring-context.xmlCode:<persistence-unit name="EJBPROJECT"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <jta-data-source>jdbc/mySQL</jta-data-source> <class>org.ejbproject.entitys.Entidade</class> <class>org.ejbproject.entitys.Estado</class> <class>org.ejbproject.entitys.Cidade</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> <properties> <property name="show_sql" value="true" /> </properties> </persistence-unit>
spring-mvc.xmlCode:<context:load-time-weaver weaver-class="org.springframework.instrument.classloading.weblogic.WebLogicLoadTimeWeaver" /> <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" /> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="EJBPROJECT" /> <property name="jpaVendorAdapter"> <bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter"> <property name="databasePlatform" value="org.eclipse.persistence.platform.database.MySQLPlatform" /> <property name="showSql" value="true" /> </bean> </property> </bean>
The Lazy collections open in view, and any change in the Spring @Service layer bean annotated with @Transaction instantly reflected in the database.Code:<tx:annotation-driven /> <tx:jta-transaction-manager /> <context:component-scan base-package="org.springmvc.spring" /> <context:annotation-config /> <mvc:annotation-driven /> <mvc:default-servlet-handler />
The web module there is nothing persistence, everything is in EJB.
JBoss 5 or 6 is J2SE server, not a JEE server.
Tanks.


Reply With Quote