geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianny Damour <gianny.dam...@optusnet.com.au>
Subject Re: NPE in TranQL when using READ-COMMITTED Transaction Isolation
Date Tue, 30 May 2006 23:41:20 GMT
Hi Vasily,

This <cache> element is used to control the isolation level of the CMP 
entity cache.

Basically, when a CMP or CMR field not yet loaded is accessed, this 
cache is queried prior to hit the database. The isolation level which is 
defined within the <cache> element is the isolation level of the cache.

Thanks for the provided stack-trace; I do know what the problem is and 
will fix that tonight.

Thanks,
Gianny

Zakharov, Vasily M wrote:

>Hi, all,
>
>I'm getting a NullPointerException in TranQL when changing Transaction
>Isolation mode with Derby. 
>
>Is it a flaw in TranQL/Derby/connector, or I'm doing something wrong?
>
>I have a simple entity like this:
>
><entity>
>    <ejb-name>ItemEnt</ejb-name>
>    <table-name>O_ITEM</table-name>
>    <cmp-field-mapping>
>        <cmp-field-name>discount</cmp-field-name>
>        <table-column>I_DISCOUNT</table-column>
>    </cmp-field-mapping>
>    <cmp-field-mapping>
>        <cmp-field-name>name</cmp-field-name>
>        <table-column>I_NAME</table-column>
>    </cmp-field-mapping>
>    <cmp-field-mapping>
>        <cmp-field-name>id</cmp-field-name>
>        <table-column>I_ID</table-column>
>    </cmp-field-mapping>
>    <cmp-field-mapping>
>        <cmp-field-name>description</cmp-field-name>
>        <table-column>I_DESC</table-column>
>    </cmp-field-mapping>
>    <cmp-field-mapping>
>        <cmp-field-name>price</cmp-field-name>
>        <table-column>I_PRICE</table-column>
>    </cmp-field-mapping>
>    <cmp-field-mapping>
>        <cmp-field-name>category</cmp-field-name>
>        <table-column>I_CATEGORY</table-column>
>    </cmp-field-mapping>
></entity>
>
>and it works fine. However if I add the following before </entity>:
>
>    <cache>
>        <isolation-level>read-committed</isolation-level>
>        <size>100</size>
>    </cache>
>
>It immediately stops working.
>
>Addressing the entity causes NullPointerException in TranQL as shown
>below.
>
>The problem occurs if <isolation-level> is "read-committed" or
>"repeatable-read"; if it is "read-uncommitted", the entity works fine.
> 
>The value of <size> doesn't matter, the effect is the same.
>
>Does Derby support read-committed isolation? DB Info in Geronimo Console
>states that it should.
>
>I use repository/tranql/rars/tranql-connector-derby-embed-xa-1.1.rar
>connector with the following deployment plan:
>
><?xml version="1.0" encoding="UTF-8"?>
><connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.0"
>    configId="SPECjAppServerDB"
>parentId="geronimo/system-database/1.0/car">
>    <resourceadapter>
>        <outbound-resourceadapter>
>            <connection-definition>
> 
><connectionfactory-interface>javax.sql.DataSource</connectionfactory-int
>erface>
>                <connectiondefinition-instance>
>                    <name>SPECDB</name>
>                    <config-property-setting
>name="DatabaseName">SPECDB</config-property-setting>
>                    <connectionmanager>
>                        <xa-transaction>
>                            <transaction-caching/>
>                        </xa-transaction>
>                        <single-pool>
>                            <max-size>100</max-size>
>                            <min-size>10</min-size>
> 
><blocking-timeout-milliseconds>60000</blocking-timeout-milliseconds>
>                            <match-one/>
>                        </single-pool>
>                    </connectionmanager>
>                </connectiondefinition-instance>
>            </connection-definition>
>        </outbound-resourceadapter>
>    </resourceadapter>
></connector>
>
>And here's the stack:
> 
>20:19:06,856 WARN  [SystemExceptionInterceptor] ItemEnt
>javax.ejb.TransactionRolledbackLocalException
>        at
>org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolic
>y.java:123)
>        at
>org.openejb.transaction.TransactionContextInterceptor.invoke(Transaction
>ContextInterceptor.java:80)
>        at
>org.openejb.SystemExceptionInterceptor.invoke(SystemExceptionInterceptor
>.java:82)
>        at
>org.openejb.GenericEJBContainer.invoke(GenericEJBContainer.java:238)
>        at
>org.openejb.proxy.EJBMethodInterceptor.intercept(EJBMethodInterceptor.ja
>va:129)
>        at
>org.openejb.proxy.EntityEJBLocalObject$$EnhancerByCGLIB$$5c64922d.getDat
>aBean(<generated>)
>        at
>org.spec.jappserver.orders.orderses.ejb.OrderSesEJB.getItemInfo(OrderSes
>EJB.java:516)
>        at
>org.spec.jappserver.orders.orderses.ejb.OrderSesEJB.newOrder(OrderSesEJB
>.java:171)
>        at
>org.spec.jappserver.orders.orderses.ejb.OrderSesEJB$$FastClassByCGLIB$$f
>f62c8dc.invoke(<generated>)
>        at
>org.openejb.dispatch.AbstractMethodOperation.invoke(AbstractMethodOperat
>ion.java:90)
>        at
>org.openejb.slsb.BusinessMethod.execute(BusinessMethod.java:67)
>        at
>org.openejb.dispatch.DispatchInterceptor.invoke(DispatchInterceptor.java
>:72)
>        at
>org.apache.geronimo.naming.java.ComponentContextInterceptor.invoke(Compo
>nentContextInterceptor.java:56)
>        at
>org.openejb.ConnectionTrackingInterceptor.invoke(ConnectionTrackingInter
>ceptor.java:81)
>        at
>org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolic
>y.java:119)
>        at
>org.openejb.transaction.TransactionContextInterceptor.invoke(Transaction
>ContextInterceptor.java:80)
>        at
>org.openejb.slsb.StatelessInstanceInterceptor.invoke(StatelessInstanceIn
>terceptor.java:98)
>        at
>org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolic
>y.java:140)
>        at
>org.openejb.transaction.TransactionContextInterceptor.invoke(Transaction
>ContextInterceptor.java:80)
>        at
>org.openejb.SystemExceptionInterceptor.invoke(SystemExceptionInterceptor
>.java:82)
>        at
>org.openejb.GenericEJBContainer.invoke(GenericEJBContainer.java:238)
>        at
>org.openejb.proxy.EJBMethodInterceptor.intercept(EJBMethodInterceptor.ja
>va:129)
>        at
>org.openejb.proxy.SessionEJBObject$$EnhancerByCGLIB$$9394b987.newOrder(<
>generated>)
>        at
>org.spec.jappserver.servlet.helper.SpecAction.doPurchase(SpecAction.java
>:534)
>        at
>org.spec.jappserver.servlet.helper.SpecAction.atomicityTestTwo(SpecActio
>n.java:195)
>        at
>org.spec.jappserver.servlet.helper.SpecServletAction.doAtomicityTests(Sp
>ecServletAction.java:1304)
>        at
>org.spec.jappserver.servlet.SpecAppServlet.performTask(SpecAppServlet.ja
>va:166)
>        at
>org.spec.jappserver.servlet.SpecAppServlet.doGet(SpecAppServlet.java:96)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>        at
>org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
>        at
>org.apache.geronimo.jetty.JettyServletHolder.handle(JettyServletHolder.j
>ava:99)
>        at
>org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(Web
>ApplicationHandler.java:830)
>        at
>org.mortbay.jetty.servlet.JSR154Filter.doFilter(JSR154Filter.java:170)
>        at
>org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(Web
>ApplicationHandler.java:821)
>        at
>org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationH
>andler.java:471)
>        at
>org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
>        at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
>        at
>org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationCon
>text.java:633)
>        at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
>        at org.mortbay.http.HttpServer.service(HttpServer.java:909)
>        at
>org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
>        at
>org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
>        at
>org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
>        at
>org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244
>)
>        at
>org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>        at
>org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
>Caused by: java.lang.NullPointerException
>        at org.tranql.cache.cache.TxCache.get(TxCache.java:111)
>        at
>org.tranql.cache.cache.FrontEndToCacheAdaptor.get(FrontEndToCacheAdaptor
>.java:56)
>        at
>org.tranql.cache.cache.FrontEndCacheDelegate.get(FrontEndCacheDelegate.j
>ava:65)
>        at
>org.tranql.cache.cache.CacheFieldFaultTransform.get(CacheFieldFaultTrans
>form.java:40)
>        at
>org.openejb.entity.cmp.CMPGetter.invokeInstance(CMPGetter.java:74)
>        at
>org.openejb.entity.cmp.CMPMethodInterceptor.intercept(CMPMethodIntercept
>or.java:75)
>        at
>org.spec.jappserver.orders.itement.ejb.ItemCmp20EJB$$EnhancerByCGLIB$$ce
>eb9f7.getDescription(<generated>)
>        at
>org.spec.jappserver.orders.itement.ejb.ItemCmp20EJB.getDataBean(ItemCmp2
>0EJB.java:245)
>        at
>org.spec.jappserver.orders.itement.ejb.ItemCmp20EJB$$FastClassByCGLIB$$c
>9f57db1.invoke(<generated>)
>        at
>org.openejb.dispatch.AbstractMethodOperation.invoke(AbstractMethodOperat
>ion.java:90)
>        at
>org.openejb.entity.BusinessMethod.execute(BusinessMethod.java:68)
>        at
>org.openejb.dispatch.DispatchInterceptor.invoke(DispatchInterceptor.java
>:72)
>        at
>org.apache.geronimo.naming.java.ComponentContextInterceptor.invoke(Compo
>nentContextInterceptor.java:56)
>        at
>org.openejb.ConnectionTrackingInterceptor.invoke(ConnectionTrackingInter
>ceptor.java:81)
>        at
>org.openejb.entity.EntityInstanceInterceptor.invoke(EntityInstanceInterc
>eptor.java:136)
>        at
>org.openejb.entity.cmp.InTxCacheInterceptor.invoke(InTxCacheInterceptor.
>java:90)
>        at
>org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolic
>y.java:119)
>        ... 46 more
>
>Vasily Zakharov
>Intel Middleware Products Division
>
>
>
>  
>



Mime
View raw message