Questions tagged [eager]

eager database fetching: efficiently load related objects along with the objects being queried.

(contrast with lazy fetching or lazy loading)

Related tags

134 questions
45
votes
4 answers

Linq for NHibernate and fetch mode of eager loading

Is there a way to set the fetchmode to eager for more than one object using linq for nhibernate. There seems to be an expand method which only allows me to set one object. However I need to set it for more than one object. Is this possible? Thanks
NabilS
  • 1,421
  • 1
  • 19
  • 31
41
votes
1 answer

Ways to avoid eager spool operations on SQL Server

I have an ETL process that involves a stored procedure that makes heavy use of SELECT INTO statements (minimally logged and therefore faster as they generate less log traffic). Of the batch of work that takes place in one particular stored the…
ConcernedOfTunbridgeWells
  • 64,444
  • 15
  • 143
  • 197
20
votes
2 answers

Hibernate: Overriding mapping's EAGER in HQL?

It's possible to override LAZY in HQL using LEFT JOIN FETCH. FROM Obj AS obj LEFT JOIN FETCH obj.otherObj WHERE obj.id = :id Is it also possible to override EAGER? How?
Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
16
votes
5 answers

How can I run the initialization code for a generator function immediately, rather than at the first call?

I have a generator function that goes something like this: def mygenerator(): next_value = compute_first_value() # Costly operation while next_value != terminating_value: yield next_value next_value = compute_next_value() I…
Ryan C. Thompson
  • 40,856
  • 28
  • 97
  • 159
12
votes
1 answer

Guice eager/lazy singleton instantiations

I'm having some troubles understanding how Guice's singleton instantiations works. I've read the available documentation (here - http://code.google.com/p/google-guice/wiki/Scopes ), but I still can't figure out some things: I've integrated Guice…
user976850
  • 1,086
  • 3
  • 13
  • 25
10
votes
1 answer

JPA eager fetching and pagination best practices

After some research I've found a lot of materials on how to write simple and efficient code (using JPQL) that: Allows eager fetching of related entities (e.g. using JOIN FETCH). Allows pagination on a single entity. But when it comes to combining…
Dmitry Kotov
  • 375
  • 3
  • 9
10
votes
3 answers

Hibernate two ManyToOne relations on one Table, the first gets Eager and the second LAZY loaded

I have got the following Entities, an item which can has up to two categories, a primary and a secondary. Both categories are mapped ManyToOne to the category table using a JoinColumnsOrFormulas. The first one gets fetched EAGER as expected, but the…
Guido Krömer
  • 477
  • 1
  • 6
  • 14
9
votes
4 answers

What is TensorFlow Eager module for?

Github links to the newly introduced Eager modules in tensorflow: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/c/eager https://github.com/tensorflow/tensorflow/tree/master/tensorflow/python/eager
myth510
  • 131
  • 1
  • 6
9
votes
2 answers

F#: how to evaluate a "seq" to get all its values eagerly?

We know that in F#, seq is lazy evaluated. My question is, if I have a seq with limited number of values, how to convert it into some data type that contains all its value evaluated? > seq { for i in 1 .. 10 do yield i * i };; val it : seq =…
vik santata
  • 2,989
  • 8
  • 30
  • 52
8
votes
3 answers

Lazy vs eager evaluation and double linked list building

I can't sleep! :) I've written small program building double linked list in Haskell. The basic language's property to make it was lazy evaluation (see the bunch of code below). And my question is can I do the same in a pure functional language with…
demi
  • 5,384
  • 6
  • 37
  • 57
8
votes
2 answers

TF.data.dataset.map(map_func) with Eager Mode

I am using TF 1.8 with eager mode enabled. I cannot print the example inside the mapfunc. It when I run tf.executing_eagerly() from within the mapfunc I get "False" import os import tensorflow as tf tf.logging.set_verbosity(tf.logging.ERROR) tfe =…
MAltakrori
  • 325
  • 2
  • 13
8
votes
3 answers

Entity Framework - Eager load two many-to-many relationships

Sorry for this being so long, but at least I think I got all info to be able to understand and maybe help? I would like to load data from my database using eager loading. The data is set up in five tables, setting up two Levels of m:n relations. So…
Ralf
  • 538
  • 1
  • 6
  • 17
7
votes
2 answers

How do you programmatically turn off eager fetching with hibernate?

I have in my mapping an association to an eagerly loaded collection (lazy="false" fetch="subselect"). How can I turn that off programmatically with Hibernate when I do a query?
Franz See
  • 3,282
  • 5
  • 41
  • 48
6
votes
2 answers

F# lazy eval from stream reader?

I'm running into a bug in my code that makes me think that I don't really understand some of the details about F# and lazy evaluation. I know that F# evaluates eagerly and therefore am somewhat perplexed by the following function: // Open a file,…
Kevin Won
  • 7,156
  • 5
  • 36
  • 54
6
votes
1 answer

Grails criteria query with fetchMode eager with two levels

In my Grails project, I have the following classes: class A { static hasMany = [cs:C] } class B { static hasMany = [cs:C] } class C { static belongsTo = [a:A, b:B] } I would like to query the class A and bring the all the associations…
lfrodrigues
  • 305
  • 3
  • 11
1
2 3
8 9