[jboss-user] DynamicQL: Disabling Read-Ahead for Relations

Christian Nolte ch.nolte at noltec.org
Wed Aug 22 03:26:43 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

I am using JBoss 4.0.4GA and have some troubles using DynamicQL. I have
two entities A and B which have a n:m relation. As I need a dynamical
sized set of entities from A, selected by n-many PKs, I use DynamicQL to
dynamically create a statement like this:

	SELECT OBJECT(a) FROM A as a WHERE a.pk IN (?1, ..., ?n)

?1, ..., ?n are generated by iterating over the collection with the PKs
which shall be selected. This works like expected and without any
problem for me.

Like I understand from reading the server.log and the DEBUG-logs in it,
the entity locals are implicitly preloaded by default (on-load) with a
page-size of n (read-ahead), even if I have not definied this behaviour
in jbosscmp-jdbc.xml. If I explicitly define a page-size of 1 for this
query, only one local is loaded at a time when it is accessed (like the
default lazy-loading behaviour for every EJB QL query). This is not what
I want, but I experimented with it. I want to pre-load every entity
which is found by the mentioned query.

The problem now is, that if I access the relation from A to B:

	AEntityLocal a = ...
	a.getBs();

and pre-loading is enabled, JBoss implicitly pre-loads all relations for
every pre-loaded entity. This is *not* what I want, because this results
in very huge statements. In this special case B has BLOBs in it and so
these are pre-loaded too. What I want is that every relation A has to
other entities are not pre-loaded.

So: Is there a way to explicitly disable this behaviour for DynamicQL?

Best regards!

Christian

- --
For more than 4 generations the IT Professionals were the guardians
of quality and stability in software. Before the dark times.
Before Microsoft...

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFGy+UzCNjA0nfhW7wRArY6AJ4ugu/w80XdzMEOledcGdWnWwG4mACglwDr
Uar6eKwqKbdbtGUbqWqKCOE=
=4w0H
-----END PGP SIGNATURE-----



More information about the jboss-user mailing list