oracle,EBS的库存数据视图
2010-01-20 11:51
337 查看
刚开始研究liferay不久,不过对liferay的功能和用的技术真多比较佩服.不过对于开发人员来说要深入了解那么的技术的不是那么容易的事情.
liferay的资料相对较少,不过去官方的论坛和wiki里面找一些东西.
最近在使用liferay的plugin portlet开发方式.
最简单的功能就是直接从数据库查询数据,插入数据等.
插入数据的话用liferay的build service工具就能自动提供接口不用那么麻烦.
不过查询的时候从BasePersistenceImpl类的openSession()的时候报了下面的错误.
com.liferay.portal.kernel.exception.SystemException: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at com.test.finder.service.persistence.TestEntryFinderImpl.findByNoAssets(TestEntryFinderImpl.java:256)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
at com.liferay.portal.dao.shard.ShardAdvice.invokePersistence(ShardAdvice.java:205)
at sun.reflect.GeneratedMethodAccessor524.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy348.findByNoAssets(Unknown Source)
郁闷了好几天.找了好些liferay的东西看也不知道解决办法.
最近跟踪代码,发现里面是sessionFactory.getCurrentSession()这个方法报错.
当时想你报错那我就不用你好了,用Session openNewSession(Connection connection)这个方法好了.
openNewSession这个方法倒是能够正常访问了,但这个是每次都打开一个新连接,然后关闭.
还是感觉用springde东西比较好.
没办法回到sessionFactory.getCurrentSession()为什么出错上来,在网上找了很久,才发现了解决办法.
service builder执行后的默认定义.
<bean id="liferayHibernateSessionFactory"
class="com.liferay.portal.spring.hibernate.PortletHibernateConfiguration">
<property name="dataSource" ref="liferayDataSource" />
</bean>
修改后的定义:
<bean id="liferayHibernateSessionFactory"
class="com.liferay.portal.spring.hibernate.PortletHibernateConfiguration">
<property name="dataSource" ref="liferayDataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.current_session_context_class">thread</prop>
</props>
</property>
</bean>
需要把这个上下文定义为线程.主要还是对hibernate和spring不熟悉,花费了不少时间.
liferay的资料相对较少,不过去官方的论坛和wiki里面找一些东西.
最近在使用liferay的plugin portlet开发方式.
最简单的功能就是直接从数据库查询数据,插入数据等.
插入数据的话用liferay的build service工具就能自动提供接口不用那么麻烦.
不过查询的时候从BasePersistenceImpl类的openSession()的时候报了下面的错误.
com.liferay.portal.kernel.exception.SystemException: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at com.test.finder.service.persistence.TestEntryFinderImpl.findByNoAssets(TestEntryFinderImpl.java:256)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
at com.liferay.portal.dao.shard.ShardAdvice.invokePersistence(ShardAdvice.java:205)
at sun.reflect.GeneratedMethodAccessor524.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy348.findByNoAssets(Unknown Source)
郁闷了好几天.找了好些liferay的东西看也不知道解决办法.
最近跟踪代码,发现里面是sessionFactory.getCurrentSession()这个方法报错.
当时想你报错那我就不用你好了,用Session openNewSession(Connection connection)这个方法好了.
openNewSession这个方法倒是能够正常访问了,但这个是每次都打开一个新连接,然后关闭.
还是感觉用springde东西比较好.
没办法回到sessionFactory.getCurrentSession()为什么出错上来,在网上找了很久,才发现了解决办法.
service builder执行后的默认定义.
<bean id="liferayHibernateSessionFactory"
class="com.liferay.portal.spring.hibernate.PortletHibernateConfiguration">
<property name="dataSource" ref="liferayDataSource" />
</bean>
修改后的定义:
<bean id="liferayHibernateSessionFactory"
class="com.liferay.portal.spring.hibernate.PortletHibernateConfiguration">
<property name="dataSource" ref="liferayDataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.current_session_context_class">thread</prop>
</props>
</property>
</bean>
需要把这个上下文定义为线程.主要还是对hibernate和spring不熟悉,花费了不少时间.
相关文章推荐
- Oracle EBS View 视图查看没有数据
- 删除Oracle某数据库下的所有表、视图等数据【转】
- Oracle 使用物化视图实现表数据同步
- Oracle基础知识(二十三) - 在Oracle的连接视图上进行数据更新操作
- ORACLE数据字典与视图及DBA常用SQL
- Oracle ASM 相关的 视图(V$) 和 数据字典(X$)
- [转]Oracle DB 性能视图和数据字典
- Oracle 没有查询数据,但是视图中有
- ORACLE EBS 系统主数据管理(A)
- ORACLE EBS 系统主数据管理(H)
- Oracle常用数据字典和视图
- ORACLE EBS AP发票到付款的数据流
- ORACLE EBS/ERP 采购库存模块分录
- oracle 静态数据字典视图 和 动态数据字典视图
- oracle 数据字典视图之 DICT / DICTIONARY
- oracle数据字典视图
- oracle数据字典及视图
- Oracle数据对象--Oracle视图
- Oracle 11g 学习八:视图、用户管理、数据的导入导出和数据表的冷备份
- 子查询 oracle输入 set语句 MERGE 事务 数据类型 约束 视图 外键