小编DHA*_*NGH的帖子

Spring Boot @Transaction(timeout = 1)

我使用的spring-boot-starter-data-jpa是 Spring Boot 1.5.6

当事务超时大于 1 时一切正常,例如 @Transaction(timeout = 2), @Transaction(timeout = 5), or @Transaction(timeout = 10),但是当我将其设置为它时,@Transaction(timeout = 1)它会在不到一秒的时间内引发异常。这是我的代码的快照:

@Transactional(readOnly=true)
public interface IUserRepository extends CrudRepository<UserEntity,Long>{
     @Transactional(timeout = 1)
     Iterable<UserEntity> findAll();
Run Code Online (Sandbox Code Playgroud)

例外是:

15:18:11.078 [http-nio-9999-exec-2] ERROR [o.a.c.c.C.[.[.[.[dispatcherServlet]:181] - Servlet.service() for servlet [dispatcherServlet] in context with path [/springJPA-LOCAL] threw exception [Request processing failed; nested exception is org.springframework.orm.jpa.JpaSystemException: nested exception is javax.persistence.PersistenceException] with root cause
javax.persistence.PersistenceException: null
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492)
at org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter.getResultList(CriteriaQueryTypeQueryAdapter.java:50)
at org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll(SimpleJpaRepository.java:329) …
Run Code Online (Sandbox Code Playgroud)

transactions spring-data-jpa spring-boot

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

未捕获的类型错误:peerConnection.addstream 不是函数?

我正在尝试附加使用getusermedia()on捕获的流startPeerConnection(stream)。我尝试通过以下方式添加流。

   function startPeerConnection(stream) {
            var configuration = {
                // Uncomment this code to add custom iceServers    //
                "iceServers": [{ "url": "stun:stun.1.google.com:19302" }]
            };

            yourConnection = new RTCPeerConnection(configuration);
            theirConnection = new RTCPeerConnection(configuration);


            // Setup stream listening 
            yourConnection.addStream(stream);//***getting the error on this line***
            theirConnection.onaddstream = function (e) {
                theirVideo.srcObject = e.stream;
                theirVideo.play();
            };


            // Setup ice handling
            yourConnection.onicecandidate = function (event) {
                if (event.candidate) {
                    theirConnection.addIceCandidate(new RTCIceCandidate(event.candidate));
                }
            };

            theirConnection.onicecandidate = function (event) {
                if (event.candidate) {
                    yourConnection.addIceCandidate(new …
Run Code Online (Sandbox Code Playgroud)

javascript webrtc

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

如何在Javascript中将字符串数组转换为JSON数组?

我有这样的字符串数组:

"[totRev=248634.29858677526, totEBITDA=34904.9893085068, EBITDA_Operating_Cash_Flow_Margin=0.140386863387, debt_Service_Coverage_Ratio=16.7793849967, gross_Debt_to_EBITDA=0.3626422278, gross_Debt=50632.09233331651, cash_Available_for_Debt=102746.09168349924, debt_Servicing_Amount=6123.352655871018]"
Run Code Online (Sandbox Code Playgroud)

我如何将其转换为JSON数组或JSON对象

{totRev:'248634.29858677526',....etc} 
Run Code Online (Sandbox Code Playgroud)

javascript json

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