DB2 WITH UR (Uncomitted Reads)

955 views
Skip to first unread message

Newbie

unread,
Sep 18, 2009, 7:08:51 PM9/18/09
to nhusers
We are using NHibernate to interact with DB2 ZOS. For general selects,
we would like NHibernate to execute all selects with "WITH UR"
keyword to perform dirty reads. We are new to NHibernate. Any ideas
on how we can automatically append "WITH UR" to all select statements?
Thanks in advance.

allan....@gmail.com

unread,
Sep 19, 2009, 10:17:42 AM9/19/09
to nhusers
The DBA's I work with gave us a similar issue but it was on SQL Server
and they wanted WITH(NOLOCK) added to every select/join. Using a
transaction isolation level of ReadUncommitted gives us the
equivalent. Not sure if it will do the same for you in DB2 or not.

using (session.BeginTransaction(IsolationLevel.ReadUncommitted)
return session.CreateCriteria<Type>().List<Type>();

Fabio Maulo

unread,
Sep 19, 2009, 5:39:24 PM9/19/09
to nhu...@googlegroups.com
If you need that isolation level for anything you can set it as default in nh-config.




--
Fabio Maulo

Fabio Maulo

unread,
Sep 19, 2009, 5:40:31 PM9/19/09
to nhu...@googlegroups.com
have a look to the IInterceptor interface.

2009/9/18 Newbie <karamj...@gmail.com>



--
Fabio Maulo

Newbie

unread,
Sep 20, 2009, 9:30:40 PM9/20/09
to nhusers
Thank you. Can you please let me know the syntax of the isolation
level I need to specify in the nhibernate config file.
Your assistance is greatly appricated.

On Sep 19, 2:39 pm, Fabio Maulo <fabioma...@gmail.com> wrote:
> If you need that isolation level for anything you can set it as default in
> nh-config.
>
> 2009/9/19 allan.ritc...@gmail.com <allan.ritc...@gmail.com>
>
>
>
>
>
>
>
> > The DBA's I work with gave us a similar issue but it was on SQL Server
> > and they wanted WITH(NOLOCK) added to every select/join.  Using a
> > transaction isolation level of ReadUncommitted gives us the
> > equivalent.  Not sure if it will do the same for you in DB2 or not.
>
> > using (session.BeginTransaction(IsolationLevel.ReadUncommitted)
> > return session.CreateCriteria<Type>().List<Type>();
>
> > On Sep 18, 7:08 pm, Newbie <karamjit.k...@gmail.com> wrote:
> > > We are using NHibernate to interact with DB2 ZOS. For general selects,
> > > we would like NHibernate to execute all selects with "WITH UR"
> > > keyword  to perform dirty reads. We are new to NHibernate. Any ideas
> > > on how we can automatically append "WITH UR" to all select statements?
> > > Thanks in advance.
>
> --
> Fabio Maulo- Hide quoted text -
>
> - Show quoted text -

Fabio Maulo

unread,
Sep 21, 2009, 12:42:47 AM9/21/09
to nhu...@googlegroups.com
attach the xsd (schema) to the file where you are writing the nh-conf.
write
<property name=
and follow the intellisense
for values accepted


2009/9/20 Newbie <karamj...@gmail.com>



--
Fabio Maulo

Zdeslav Vojkovic

unread,
Sep 21, 2009, 5:11:35 AM9/21/09
to nhu...@googlegroups.com
<property name="connection.isolation">ReadUncommitted</property>

there is a sample here: https://forum.hibernate.org/viewtopic.php?f=25&t=999284
Reply all
Reply to author
Forward
0 new messages