Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Oracle 弹簧数据jpa隔离_Oracle_Spring Data Jpa_Spring Transactions - Fatal编程技术网

Oracle 弹簧数据jpa隔离

Oracle 弹簧数据jpa隔离,oracle,spring-data-jpa,spring-transactions,Oracle,Spring Data Jpa,Spring Transactions,我使用SpringBoot和SpringDataJPA以及hibernate和oracle 我需要从一个包含数百万条记录的数据表中获取数据,然后将数据写入一个文件中。写入数据后,我需要删除该行。 我使用流来获取数据 在这些过程中,可以(通过另一个程序)将一些其他数据插入表中 不知道在对数据库进行流式处理时,是否向查询中添加了新的插入 我在想做点什么 public void processData(){ //create file Stream<Billing> b

我使用SpringBoot和SpringDataJPA以及hibernate和oracle

我需要从一个包含数百万条记录的数据表中获取数据,然后将数据写入一个文件中。写入数据后,我需要删除该行。 我使用流来获取数据

在这些过程中,可以(通过另一个程序)将一些其他数据插入表中

不知道在对数据库进行流式处理时,是否向查询中添加了新的插入

我在想做点什么

public void processData(){

  //create file    

  Stream<Billing> billingStream = billingRepository.getAll();

  billingStream.forEach( billing-> {

    //write billing row to file

    //delete billing row; //should be remove in memory
    entityManager.remove(billing);

  });

}
public void processData(){
//创建文件
Stream billingStream=billingRepository.getAll();
billingStream.forEach(计费->{
//将帐单行写入文件
//删除帐单行;//应在内存中删除
entityManager.remove(计费);
});
}

如果插入,是否有办法避免使用它?

流API仅检索所有元素的列表。它可以将检索到的列表转换为一个流。我认为使用分页可以避免所有这一切,这对于检索元素来说会更好,如果重要的话,性能也会更好。这取决于实现,看起来像hibernate使用Scroll。流API只检索所有元素的列表。它可以将检索到的列表转换为一个流。我认为使用分页可以避免所有这一切,对于检索元素来说,分页会更好,如果重要的话,还会有更好的性能。这取决于实现,就像hibernate使用scroll一样