竞赛

spring3+hibernate4 service 中多线程事务异常及解决

初次使用spring3结合hibernate4做项目,迅速配置完成,测试,一切正常。

然而,当我在service层中另外开启一个线程,线程中的方法需要进行数据库操作,这个时候,悲催的抛出了异常:-org.hibernate.HibernateException: No Session found for current thread

当然,hibernate4的session是和当前线程绑定的,多线程中用sessionFactory.getCurrentSession()获取当前session自然不存在,不存在又不会自动创建,所以抛出了异常,无可厚非。

于是就想着怎么解决这个问题。

遍翻google、baidu,大部分都说如何如何配置,设置事务的传播属性propagation="REQUIRED",开启opensessioninview filter等等,无一对此问题有何解释(当然或许是我没翻到,有知道的麻烦告知)

在http://sishuok.com/forum/blogPost/list/2625.html#7523上看到相关配置,我就想作者这个项目该多线程运行正常吧,果断下载源码,修改测试,oh。。。跟我的错一模一样!

¿Quiere una laptop con cámara Intel RealSense para crear mejores juegos?

Tell us how you could use a laptop with the latest 5th Generation Intel® Core™ processor and an Intel® RealSense™ camera to make new and amazing game experiences, and you might be selected to receive one of three laptops up for grabs this month. Contest open to U.S. residents only, restrictions apply.

Want a Laptop with an Intel® RealSense™ 3D Camera to Make Better Games?

Tell us how you could use a laptop with the latest 5th Generation Intel® Core™ processor and an Intel® RealSense™ camera to make new and amazing game experiences, and you might be selected to receive one of three laptops up for grabs this month. Contest open to U.S. residents only, restrictions apply.

中国选手入榜实感技术应用挑战赛

中国选手入榜实感技术应用挑战赛

英特尔百万美元奖金尘埃落定

英特尔®实感TM技术从问世之初便备受瞩目。在刚刚过去的英特尔信息技术峰会(IDF15)上,英特尔®实感TM技术更是大放异彩,通过实感技术及3D摄像头,开场音乐会上演奏家们的身姿以数字的状态实时呈现,给台下观众带来了视觉、听觉的双重震撼。

如今,实感技术随着创新渠道的不断更新,生态系统的逐步壮大,已经在游戏、社交、家居等领域得到了大力发展。再加上在各种终端设备上的拓展,实感技术的未来必将势不可挡。为了加速实感技术更加广泛地应用,2014年6月,在台北国际电脑展(Computex)上,英特尔总裁詹瑞妮宣布,启动英特尔实感技术应用挑战赛,旨在鼓励开发人员为台式机、笔记本和平板开发创新性的应用程序。近日,英特尔宣布了英特尔实感技术应用挑战赛的获奖者, 百万美金奖励终尘埃落定。

7000开发者争夺百万奖金

June 2015 Hardware Seeding Contest - Win one of 10 Android Tablets

This month’s hardware seeding contest is for one of ten (10) Acer Iconia Tab 8 (model A1-840FHD) Android tablets with a quad core Intel® Atom™ Z3745 processor. That means ten game devs will walk away with one each! These tablets have a 1900x1200 8" screen, 2GB of RAM, and are fully 64-bit capable. Read on to find out how you could win one of the 10 devices we're giving away this month.

Win a Trip to Barcelona - Enter the Connect and Enrich Android App Challenge

Want to win one of ten trips to Barcelona, along with a ticket to Mobile World Congress 2015 and a spot to present at the Mobile Premier Awards? Join the Connect and Enrich Android App Challenge, powered by AppCircus and sponsored by Intel Software.

Connect and Enrich App Challenge

订阅 竞赛