小编Vis*_*ish的帖子

交易的传播行为

我正在使用基于注释的声明方法来实现spring aop.示例代码

ClassA{
@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)
add()
{
method1();
method2();
method3();

}
}
Run Code Online (Sandbox Code Playgroud)

但我仍然怀疑使用传播.传播.Requires_New意味着每个请求都将启动新事务.

第二个问题:

是不是像method2,method3这样的方法失败会导致事务回滚?

如果有任何可以帮助我倾斜交易传播,我将非常高兴.

有人可以为我提供一个真实世界的例子,我们需要参与现有的交易.因为我想象我们在上面的例子中使用的添加功能将对所有用户独立,或者任何其他功能将独立于每个正在呼叫的用户.我无法找到使用PROPAGATION_SUPPORTS,PROPAGATION_MANDATORY,PROPAGATION_REQUIRES_NEW等其他传播行为的示例

java spring transactions spring-aop

8
推荐指数
1
解决办法
2万
查看次数

Spring hibernate事务日志记录

我们如何记录spring transaction机制.我将在下面的示例中显示Spring Doc sec 10.5.2中显示的示例.如果我想记录到这个级别如何做到这一点

我正在使用Spring,Hibernate和Log4j.

<!-- the Spring container is starting up... -->
[AspectJInvocationContextExposingAdvisorAutoProxyCreator] - Creating implicit proxy
for bean 'fooService' with 0 common interceptors and 1 specific interceptors
<!-- the DefaultFooService is actually proxied -->
[JdkDynamicAopProxy] - Creating JDK dynamic proxy for [x.y.service.DefaultFooService]
<!-- ... the insertFoo(..) method is now being invoked on the proxy -->
[TransactionInterceptor] - Getting transaction for x.y.service.FooService.insertFoo
<!-- the transactional advice kicks in here... -->
[DataSourceTransactionManager] - Creating new transaction with …
Run Code Online (Sandbox Code Playgroud)

java logging spring

7
推荐指数
2
解决办法
2万
查看次数

在Websphere上使用Aspectj

我们在Spring源工具套件中使用Aspectj编译时加载..当我们尝试在websphere服务器上部署这个项目时,我们得到了以下异常.这个项目在tomcat服务器上工作得很好..库存在一些问题AspectJ编译器已经存在于Spring Source Tool中.

Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions
(1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: 
Property 'exceptionProp' threw exception; nested exception is java.lang.NoSuchMethodError:   org/aspectj/runtime/internal/AroundClosure.linkClosureAndJoinPoint(I)
Lorg/aspectj/lang/ProceedingJoinPoint
Run Code Online (Sandbox Code Playgroud)

websphere spring aspectj java-ee

4
推荐指数
1
解决办法
4619
查看次数

Spring 3.1 Cache名称空间问题

我试图使用3.1弹簧缓存配置和命名空间按照春季文档.我也从春季网站下载了最新的jar,但我仍然遇到有关命名空间的问题

Unable to locate Spring NamespaceHandler for element 'cache:annotation-driven' of schema namespace 'http://www.springframework.org/
Run Code Online (Sandbox Code Playgroud)

模式/高速缓存"

spring配置文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:cache="http://www.springframework.org/schema/cache"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">


cache:annotation-driven />

<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cache-manager-ref="ehcache"/>
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" 
    p:config-location="classpath:ehcache.xml"/>
Run Code Online (Sandbox Code Playgroud)

spring caching

3
推荐指数
1
解决办法
2万
查看次数

Grails作为单个应用程序或不同的后端和前端应用程序

我们是grails的新手,并担心以下问题:

  1. 可扩展性问题

  2. 对不同的应用程序使用相同的后端

所以坚持单个grails是个好主意,或者我们应该分开关注点,甚至使用其他框架如node.js来使用rest来实现前端.

其次我不是很清楚,我们应该把业务逻辑放在grail app.Ideal place应该是我想的服务

我们正在检查Angular.js,因为它似乎比gsp页面更快,前端的当前风格和与grail的集成也更容易.想要检查是否是正确的选项.

architecture grails grails-orm node.js angularjs

3
推荐指数
1
解决办法
3893
查看次数

在运行时从属性文件中读取值

我想根据属性file.how的请求获取特定值来做到这一点?

我有以下spring配置.我想根据请求设置Exprops的值,并从属性文件中获取相应的值

<bean id="Prop" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="location">
        <value>classpath:ErrorMessage.properties</value>
    </property>
</bean>

<bean id="PropertiesBean" class="com.util.PropertiesUtil">
    <property name="Exprops" value="${EXampleExceptiion}"></property>
</bean>
Run Code Online (Sandbox Code Playgroud)

spring properties

1
推荐指数
1
解决办法
2万
查看次数

TestNG:未知选项'-serport'

我在Eclipse Keplar中使用TestNG.我按照这里提供的确切步骤安装Eclipse的TestNG插件.安装成功.

当我尝试运行TestNG testsuite时,我收到错误

[testng] Unknown option: -serport'
Run Code Online (Sandbox Code Playgroud)

如何从Eclipse的Run As TestNG test菜单中删除此选项或编辑Eclipse的配置文件以从中删除此选项Run as TestNG test

堆栈跟踪

 Exception in thread "main" com.beust.jcommander.ParameterException: Unknown option: -serport
    at com.beust.jcommander.JCommander.parseValues(JCommander.java:742)
Run Code Online (Sandbox Code Playgroud)

eclipse testng eclipse-plugin

1
推荐指数
1
解决办法
1410
查看次数