简体   繁体   English

weblogic + eclipselink + 2个不同的线程=延迟加载不起作用

[英]weblogic + eclipselink + 2 different thread = lazyloading don`t work

I have two threads one of them write text field to the database, another try to read this field but it can`t. 我有两个线程,其中一个将文本字段写入数据库,另一个尝试读取此字段,但是不能。

field has following anatation: 字段具有以下特性:

@Lob
    @Column(name = "response_soap")
    @Basic(fetch = FetchType.LAZY)
    public String getResponseSoap() {
        return responseSoap;
    }

Both thread it's part of the web application. 这两个线程都是Web应用程序的一部分。 Both running on the same weblogic server. 两者都在同一台weblogic服务器上运行。 All transaction is commited. 所有事务都已提交。 There is field in the database. 数据库中有字段。 Every time I'm creating new Entity manager. 每次创建新的实体管理器时。

What error do you get? 你得到什么错误?

Try using a refresh, em.refresh(object) 尝试使用刷新,em.refresh(对象)

Are you serializing the object? 你序列化对象? Since it is LAZY it will be null when you serialize it, unless you access before you serialize it. 既然是LAZY这将是空时序列化,除非你访问你序列化之前。 Try making it EAGER. 尝试使其更EAGER。

I believe that only Many-to_many and One-to-many are can be set to lazyload 我相信只能将“多对多”和“一对多”设置为“延迟加载”

One-to-one, Many-to-one and Basic are all Egar 一对一,多对一和基本都是Egar

http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Lazy_Basics http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Lazy_Basics

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM