1 2 Previous Next 22 Replies Latest reply on Nov 24, 2011 3:30 PM by lightguard Go to original post
      • 15. Re: Applied Transactional on a view action will cause excption...
        hantsy

        尽量使用 Seam managed persistence context, 理论上它提供了更多的功能,比如在 hql 使用表达式,比如避免 lazyInitializationexception(我已经报了发现的一个相关的问题)。。。


        目前 Seam 3 官方应该没有精力去关注其他服务器,所以最好用 Jboss7。我曾经想在 Tomcat 7 中使用 Seam 3.0 Final 结果发现根本就不行。


        Seam3 的开发进度令人担忧, 最近一个星期几乎没代码更新。 Seam 团队之前已经发布过声明了, Seam 3.1 是最近一个以Bundle形式发布的包,以后的版本就散了,persistence 模块归 Hibernate管了,JSF模块划到 Richfaces,REST支持丢给 Resteasy了。


        目前Seam 3.1.0 Beta4中有一个重大的 Transaction 异常问题(alread in transaction 之类的),但不是每次都出现,我经常遇到。。这已经在Jira中看到了。


        Seam3 扩展了 CDI 的 Conversation,同样提供了@Begin,@End(Seam2 中的概念),但不好用,问题多。


        实际应该多关注一下 MyFaces,和 MyFaces CODI(以前没在意这个项目,直到最近一直想找Seam3 的替代品才想到了它),这个与Seam3 直接形成了竞争,CODI 中 重新设计了 Converstation  ,并添加@WindowScoped @ViewAccessScoped等,同时 CODI 对jsf(JSF的扩展方面比 Seam Faces完美), messages, persistence 等都有扩展,但它没有mail, reports等应用相关部分。

        • 16. Re: Applied Transactional on a view action will cause excption...
          hantsy

          看来 3.1.0 Beta5 要发布了, GIT 中已经添加 Tag了。

          • 17. Re: Applied Transactional on a view action will cause excption...
            ratking

            一年多了,我终于在seamframework找到一个使用中文的人了!
            无比兴奋 ~(*_*)~


            刚在MSN里加了你,估计你也忙,不过,为了学习Seam3,恐日后多有骚扰。
            在此先行谢过。


            借此宝地,现说说我对Seam3的看法:
            1. 如你所说,Seam3的开发进度令人担忧,git里近期没有更新:-(,这说明核心研发人员也可能出现异动。
            2. Seam3各个模块估计以后会散,比如是否persistence并入Hibernate,faces并入RichFaces、drools并入drools。
            关键是,变动后对其他JPA、JSF实现是否还能支持?换句话说,如果Seam3没有实现先前承诺的目标:可移植性和兼容性(http://in.relation.to/Bloggers/IsSeam3GoingToBePortableOrWhat),其他人就有理由认为Seam3是完全与JBoss其它产品密切绑定的,是no-JEE6的。我一定会抛弃Seam3。
            3. Seam 3官方应该没有精力去关注其他服务器,这个我理解。毕竟对一个公司而言,Money(¥$)是生存的根本。但同时,市场是残酷的,如果其他那些已经通过Java EE 6认证的服务器里都不能运行Seam3,只有JBoss独自一个能运行Seam3,那么,Seam3就只能在JBoss/RedHat的有限的空间内生存。这是竞争不过Spring的。
            4. Seam 3的文档少、内容滞后、有错误,这个我理解。但另一个问题我就不理解了:我迄今为止还没有找到一个可以运行无误的CRUD的Seam3例程!我自己也没有运行成功一个 :-( 我太笨吗?booking虽然能运行,可是功能太弱,经不起推敲和检验。我非常想做一个程序,带有添加、修改、删除、查询功能,在程序中使用SMPC管理数据库连接,JPA里使用多对多、一对多或多对一的关系,在JSF里使用不同的上下文(Conversation/ViewScoped)维护bean的生命周期,使用EJB3.1处理事务与定时任务。可惜,这样的例子我没找到,我自己写的验证程序又总报异常,比如事务异常、懒加载异常,使我甚至怀疑Seam3是否与Java EE 6兼容。我使用的是GlassFish而不是JBoss,但我从论坛中其它人提出的问题与疑惑态度来看,感觉Seam3在JBoss中运行得也不理想,否则就不会有那么多原来使用Seam2的人也抱怨Seam3了。
            5. 我下载了seam3-sandbox,应该是你没有提交完全,尚缺Comment.java和comments.xhtml,我在GlassFish中,只要同时使用SMPC和EJB一定报错,这个seam3-sandbox程序我补充缺失的文件后在GlassFish里运行也是报错(事务异常)
            6. 需要定位一下哪些异常是开发人员错误使用Seam3导致的?哪些异常是Seam3的缺陷导致的?哪些异常是Weld的缺陷导致的?哪些异常是GlassFish的缺陷导致的?这几个都是新东西,是谁的问题还不真好说,但Seam3嫌疑更大。
            7. 你提的几个建议我会抽时间看看、测测……
            8. 抱怨归抱怨,还是非常感谢Seam3的开发人员,感谢seamframework.org,同时也感谢国家感谢党,伟大的功夫网万岁。


            In short, I would like to know, Is Seam3 Going To Be Portable Or What ?
            Life or death, this is a problem!

            • 18. Re: Applied Transactional on a view action will cause excption...
              hantsy

              在 Glassfish 中使用至少要安装 Hibernate(使用 Glassfish 中AutoUpdate工具安装,也可以尝试使用 EclipseLink),另外自己创建 DataSource,运行首先确保persistence.xml 中所有配置是在运行环境中是正确的。


              我的 seam3-sandbox 是用来报 BUG 的演示程序,所以运行肯定会有问题(异常)。

              • 19. Re: Applied Transactional on a view action will cause excption...
                ratking

                我在GlassFish中测试,发现SMPC(带有@ExtensionManaged的实体管理器)与GlassFish中的会话BEAN(有状态或无状态)是不兼容的。
                原因好像是在GlassFish的会话BEAN中,由于EJB已经是带事务的,因此GlassFish里不许调用InitialContext.lookup("java:comp/UserTransaction")
                这件事在Seam手册里没有描述。


                参见:
                http://seamframework.org/Community/SMPCIsIncompatibleWithSessionBeanInGlassFish
                https://issues.jboss.org/browse/SEAMTRANSACTION-7

                • 20. Re: Applied Transactional on a view action will cause excption...
                  lightguard

                  Sorry all, but if you'd like me, or other developers to help with this, posts should be in English, or at least a translation of the Chinese.

                  • 21. Re: Applied Transactional on a view action will cause excption...
                    ratking

                    Sorry for my poor English.


                    I'd like you.
                    If pay more attention to other JavaEE 6 server(eg. GlassFish), the better.


                    Thank you and your team. Your contribution to make this world a better place.

                    • 22. Re: Applied Transactional on a view action will cause excption...
                      lightguard

                      We spent a lot of time on Glassfish with Seam 3.0.0 and helped them fix a number of the Weld integration issues, however, there are still more and they haven't fixed them. We also created a number of workarounds for Glassfish, but it's not reasonable for us to continue to work around bugs they have and know about but have not fixed.

                      1 2 Previous Next