Code Monkey home page Code Monkey logo

Comments (3)

tang-jie avatar tang-jie commented on September 13, 2024

您好,请问下你是怎么测试的?我用github上面最新的版本,运行成功,没有出现卡死。
能不能给出代码和测试用例?附上我的测试步骤:
1、加载maven依赖:

org.springframework
spring-tx
4.1.1.RELEASE

2、测试服务代码:
import com.newlandframework.rpc.services.PersonManage;
import com.newlandframework.rpc.services.pojo.Person;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@service
public class PersonManageImpl implements PersonManage {
@transactional
public int save(Person p) {
//your business logic code here!
System.out.println("Transactional person data[" + p + "] has save!!!");
return 0;
}

public void query(Person p) {
    //your business logic code here!
    System.out.println("person data[" + p + "] has query!");
}

}

3、RPC服务端运行结果:
rpc

from nettyrpc.

qianzhiheilv avatar qianzhiheilv commented on September 13, 2024
 <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
        <!--驱动类-->
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <!--数据库地址,指向库 -->
        <property name="url" value="jdbc:mysql://127.0.0.1:3306/134"/>
        <!--用户名 -->
        <property name="username" value="1111"/>
        <!--密码 -->
        <property name="password" value="1111"/>
    </bean>

    <!-- 定义JdbcTemplate的Bean -->
    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
        <constructor-arg name="dataSource" ref="dataSource"/>
    </bean>


    <bean id="sqlTxManager"
          class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <tx:annotation-driven transaction-manager="sqlTxManager"/>

我就加了这个配置,然后其余和你一样,加了tx,jdbc包,加了注解事务的xml,然后测试的

from nettyrpc.

tang-jie avatar tang-jie commented on September 13, 2024

这个应该和NettyRPC没有太大关系。我手头没有mysql运行环境,所以测试样例以oracle来替代,参考你提供的配置。可以看这里:JDBC服务参考代码链接。oracle测试是没有问题的,你更新一下最新NettyRPC版本试一下。

from nettyrpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.