我已经基于Gianpaolo SaaS成熟度模型对SaaS成熟度水平进行了一些研究.
现在我对SaaS成熟度等级4感到困惑.它说,它有一个"租户负载均衡器",动态调用新的应用程序实例来为SaaS应用程序提供负载平衡.
我想知道这个"租户负载均衡器"究竟意味着什么.我们如何在现实世界或应用服务器中实现这个"租户负载均衡器"?
任何人都可以给我一些很好的解释和一个例子,比如Java EE技术中的实现吗?
我发现我的hibernate程序很奇怪.这是我的代码
public Set<AnotherClass> getAnotherClassSetsFromSomeClass() {
Session session = HIbernateUtil.getSessionFactory().openSession();
Transaction trans = session.beginTransaction();
SomeClass sc = (SomeClass)session.get(SomeClass.class,"classId");
trans.commit();
session.close;
return sc.getAnotherClassSet();
}
Run Code Online (Sandbox Code Playgroud)
如果我在Java控制台上运行它,这段代码看起来很好.
如果我使用它一个Web应用程序(JSF),我收到此错误
懒得初始化 - 没有会话或会话被关闭
它具有一对多关系(一个SomeClass有许多AnotherClass)
异常消息指向返回sc.getAnotherClassSet()为空指针.我确信我的数据库中有这些数据.
好吧,我发现,如果我添加System.out.println(sc.getAnotherClassSet())berfore return sc.getAnotherClassSet()我的代码工作正常.
知道发生了什么事吗?谢谢.
我使用JSF 2.2 + Spring框架3.2.4
所以,我有这个applicationContent.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
<aop:aspectj-autoproxy proxy-target-class="true" />
<tx:annotation-driven transaction-manager="transactionManager"/>
<context:annotation-config/>
<context:component-scan base-package="com.vulcan.controller" />
<context:component-scan base-package="com.vulcan.service" />
<context:component-scan base-package="com.vulcan.dao" />
<context:component-scan base-package="com.vulcan.spring.aop" />
.....
Run Code Online (Sandbox Code Playgroud)
然后我有方面组件
package com.vulcan.spring.aop;
@Aspect
public class LoggingService {
private Log log = LogFactory.getLog(this.getClass());
@Pointcut("execution(* *.*(..))")
protected void loggingOperation() {}
@Before("loggingOperation()")
public void logJoinPoint()
{
System.out.println ("Hello");
}
....
Run Code Online (Sandbox Code Playgroud)
通过这种类型的执行,我假设将在每个方法上触发此切入点.但问题是,这个切入点没有被触发?知道为什么吗?谢谢
仅供参考,我使用glassfish 4,当我部署我的网络应用程序时,我没有收到任何错误配置.所以我认为我的配置很好.
aspectj ×1
hibernate ×1
java-ee ×1
jsf ×1
lazy-loading ×1
maturity ×1
saas ×1
spring ×1
spring-aop ×1