Paging mechanism in EJB
I am trying to improve the performance of a huge report (around 80,000) records. The application uses stateless session bean and it fetches the records in a loop one at a time. I want to change it in such a way it uses oracle stored procedure that fetches 1000 records at a time. When a user wants to see the next set of 1000 records he/she should be able to see by clicking on a link. I�m pretty new to EJB. Before even I proceed I want to make sure that if I am taking the right approach. Now my question is, can I implement Paging mechanism in EJB. If so how feasible it is? Is there any other better way to do it?
hey how are you. I use following paging mechnism. There is paging method, which generates paging links.
public PagingInfo paging (String baseUrl , String currentPage , Long totalItems , Integer itemsPerPage)
Integer cPage = getInteger (currentPage) ; // if currentPage is valid Integer, return Integer value, else returns null
if (cPage == null || cPage < 1)
cPage = 1 ;
Long totalPages = 1L ;
Integer i ;
while (totalPages * itemsPerPage < totalItems)
totalPages ++ ;
Integer start = (cPage - 1) * itemsPerPage ;
if (baseUrl.lastIndexOf("?") == -1)
baseUrl = baseUrl.concat("?") ;
else
baseUrl = baseUrl.concat("&") ;
String output = "" ;
if (totalPages > 1)
List <String> pages = new ArrayList <String> () ;
if (cPage > 1)
pages.add (li (link (baseUrl + "page=" + (cPage - 1) , "previous page"))) ;
for (i = 1 ; i <= totalPages ; i ++)
if (cPage.equals(i))
pages.add (li (String.valueOf(cPage))) ;
else
pages.add (li (link (baseUrl + "page=" + i , String.valueOf(i)))) ;
if (cPage < totalPages)
pages.add (li (link (baseUrl + "page=" + (cPage + 1) , "next page"))) ;
Integer size = new Integer (pages.size()) ;
for (i = 0 ; i < size ; i ++)
output = output.concat(pages.get(i)) ;
output = div (ul (output) , "pages") ;
return new PagingInfo (start , itemsPerPage , cPage , output) ;
}PagingInfo declared like this :
public class PagingInfo {
Integer start ;
Integer itemsPerPage ;
Integer currentPage ;
String output ;
public Integer getStart() {
return start;
public Integer getItemsPerPage() {
return itemsPerPage;
public Integer getCurrentPage() {
return currentPage;
public String getOutput() {
return output;
public PagingInfo(Integer start, Integer itemsPerPage, Integer currentPage,
String output) {
this.start = start;
this.itemsPerPage = itemsPerPage;
this.currentPage = currentPage;
this.output = output;
public PagingInfo() {}
}And your code should be like this
PagingInfo pi = paging ("servletname?action=view" , request.getParameter ("page") , itemCount , itemsPerPage) ;
Query ejbQuery = manager.createQuery("SELECT d FROM DataTable d");
ejbQuery.setMaxResults (pi.getItemsPerPage ()) ;
ejbQuery.setFirstResult (pi.getStart ()) ;
List result = ejbQuery.getResultList();
out.print (pi.getOutput ()) ; // paging links
while ()
// printing your item list
out.print (pi.getOutput()) ; // paging links
Similar Messages
-
Hi friends
what is the best way to implement a paging mechanism in an application using servlets/jsp
Anyone who have done this , please advise
TIAThere are 4 ways
1. If database supports limit like SQLServer supports top keyword and MySQL supports Limit keyword(The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments).
2. You can store all the rows in a data structure and by using 1 or 2 variables you can get data from this data structure. Put this data structure in session.
3. You can implement paging logic in method that is fetching records from db, mean dont store all records in data structure and session. Just skip records in RecordSet that are not required. And return required records to JSP. In this way you need to fetch all the records from db on every request of page. But you dont need to make your session heavy and u will always get updated data. In case of session you will get old data.
4. There are tag libraries available on the net, you can use them for paging.
I hope you got the idea............... -
Hi
What is the best way to do paging with JDBC when using PL/SQL Cursor. I want to create DAOs that access PL/SQL Cursors with a paging mechanism. The DAO must be stateless.
Regards,
Nestor BoscanNestor,
While I'm not trying to take away from Mikael's suggestion, the way I do it (which was implemented before the existence of "OracleCachedRowSet") is to maintain a scrollable "ResultSet" on the server, and send "Collection"s to the client. But beware of very large "ResultSet"s, because the Oracle JDBC driver implements scrollable "ResultSet"s via client memory.
In any case, paging has been discussed previously in this forum. Did you try searching the forum archives?
Good Luck,
Avi. -
Flex mobile paged list troubles with destructionPolicy
Hello,
i have set a list with data paging in a flex mobile view with destructionPolicy=never, when coming back to this view i get some errors when the paging mechanism is triggered (there is no errors when all of the items were previously fetched).
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.data::RPCDataServiceAdapter/http://www.adobe.com/2006/flex/mx/internal::addPagingParameters()[C:\depot\DataServices\br anches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as :1108]
at mx.data::RPCDataServiceAdapter/pageQuery()[C:\depot\DataServices\branches\milestone\lcds4 5_fb45\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:411]
at mx.data::RPCDataServiceAdapter/processDataMessage()[C:\depot\DataServices\branches\milest one\lcds45_fb45\frameworks\projects\data\src\mx\data\RPCDataServiceAdapter.as:1069]
at RPCDataServiceRequest/invoke()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frame works\projects\data\src\mx\data\RPCDataServiceAdapter.as:1786]
at mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::invoke()[C:\depot\DataServices\branches\milest one\lcds45_fb45\frameworks\projects\data\src\mx\data\DataStore.as:3497]
at Function/<anonymous>()[C:\depot\DataServices\branches\milestone\lcds45_fb45\frameworks\pr ojects\data\src\mx\data\DataStore.as:1716]
at mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::fill()[C:\depot\DataServices\branches\mileston e\lcds45_fb45\frameworks\projects\data\src\mx\data\DataStore.as:1767]
at mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::processPageRequest()[C:\depot\DataServices\bra nches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\DataStore.as:1854]
at mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/internal::processPageRequest()[C:\depot\DataServices\bra nches\milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\ConcreteDataService.as:50 35]
at mx.data::DataList/http://www.adobe.com/2006/flex/mx/internal::requestItemAt()[C:\depot\DataServices\branches \milestone\lcds45_fb45\frameworks\projects\data\src\mx\data\DataList.as:1201]
at mx.data::DataList/getItemAt()[C:\depot\DataServices\branches\milestone\lcds45_fb45\framew orks\projects\data\src\mx\data\DataList.as:364]
at mx.collections::ListCollectionView/getItemAt()[E:\dev\4.5.1\frameworks\projects\framework \src\mx\collections\ListCollectionView.as:511]
at mx.collections::AsyncListView/getItemAt()[E:\dev\4.5.1\frameworks\projects\framework\src\ mx\collections\AsyncListView.as:701]
at spark.components::DataGroup/getVirtualElementAt()[E:\dev\4.5.1\frameworks\projects\spark\ src\spark\components\DataGroup.as:1446]
at spark.layouts::VerticalLayout/updateDisplayListVirtual()[E:\dev\4.5.1\frameworks\projects \spark\src\spark\layouts\VerticalLayout.as:1807]
at spark.layouts::VerticalLayout/updateDisplayList()[E:\dev\4.5.1\frameworks\projects\spark\ src\spark\layouts\VerticalLayout.as:2105]
at spark.components.supportClasses::GroupBase/updateDisplayList()[E:\dev\4.5.1\frameworks\pr ojects\spark\src\spark\components\supportClasses\GroupBase.as:1294]
at spark.components::DataGroup/updateDisplayList()[E:\dev\4.5.1\frameworks\projects\spark\sr c\spark\components\DataGroup.as:1373]
at mx.core::UIComponent/validateDisplayList()[E:\dev\4.5.1\frameworks\projects\framework\src \mx\core\UIComponent.as:8989]
at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.5.1\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:736]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:819]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1180]
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
is there any way to prevent this ?Nobody any idea?
i tried it like its described in this article:
Declaring file type associations
http://livedocs.adobe.com/flex/3/html/help.html?content=File_formats_1.html
but i can't get it running for my mobile project. The type associations works fine in my desktop air application but it doesn't work in my mobile app. Is this type associations stuff supposed to be working on mobile devices / android? -
Hello everybody,
First, excuse me for the mistakes I may have made.
I am a trainee and the enterprise I work for is planning to
change the presentation layer (and maybe all the layers) of their
software packages for Flex (at the present time they use the .NET
platform). But in order to ensure that Flex can answer their needs,
they have asked me to make a model using Flex together with Java,
Hibernate, LCDS, SQL Server and Tomcat.
I am currently using those versions :
- jdk 1.5.0_12
- Hibernate 3 (I use the jars provided with LCDS)
- LCDS 2.5
- SQL Server 2005
- Tomcat 5.5
As far as some of the tables from their databases are quite
big (they can reach 2.000.000 rows) I need to implement paging. The
table I currently use for my example is "only" 10.000 rows.
I must confess that I am new to n-tiers architectures and
that there are many concepts I misunderstand.
What I want to do is make the user able to choose how many
rows a page he wants to display (This could look a bit like
this). And
the server would only send this number of rows for each page (which
is not the case for the page I linked).
I have noticed that the implementation of the fill method for
the HibernateAssembler had changed between FDS (
public Collection fill(List fillArgs)) and LCDS (
public Collection fill(List fillArgs, int startIndex, int
numItems)).
You are now able to specify a start index and the number of
rows to display. This is the method I would like to use.
To do so, I have tried to refer to
LCDS
documentation but I find it quite confusing. Here it is :
Using on-demand paging
There are two ways in which the Data Management Service
implements on-demand paging of data by Flex clients. In the default
approach, the fill method returns the entire collection of objects.
The server sends the first page of items to the client as part of
the initial fill request.
As the client code tries to access ArrayCollection elements
which are not resident, additional pages are retrieved from the
server. If the cache-items property is set to true, these pages are
sent directly by the Data Management Service. If the cache-items
property is set to false, the Data Management Service calls the
getItem() method for each item it needs to send to the client.
When the original query is too large to be held in the
server's memory, it is desirable for the Assembler to only return a
single page of items at a time. In this mode, each time the client
requests a page, the Assembler is asked for that page of items and
they are sent directly to the client. Currently this mode is not
supported when the autoSyncEnabled property is set to true for the
paged collection. You must set the autoSyncEnabled property to
false before executing the code. This configuration is not
supported for the SQLAssembler. It is supported for the
HibernateAssembler and you can implement it with your own Java
Assembler implementation.
To enable this second mode, you set the custom="true"
attribute on the paging element in your network settings on the
server and ensure paging is enabled with a reasonable pageSize
value.
If you are using the fill-method approach in your Assembler,
you specify a fill method that matches the fill parameters used by
your client with two additional parameters: the startIndex and the
number of items requested. The Data Management Service calls this
method once for each page requested by the client.
If you are using the Assembler interface approach, you
override the useFillPage() method for the appropriate fill method
to return true for the fill parameters you want paged using custom
paging. When the client requests a page, it calls the fill variant
in the Assembler interface which takes the additional startIndex
and number of items parameters. You return
just those items and they are returned to the client.
When you use custom paging in either the fill-method or
Assembler approach, there are two ways that the client can
determine the size of the collection. When you have enabled the
custom paging mode, on the initial fill request made by the client,
the Data Management Service invokes the count method with the
parameters the client passed to fill. If the count
method returns -1, a dynamic sizing algorithm is used for
this filled collection. In this approach, the assembler's paged
fill method is called with startIndex of 0 and number of items set
to the pageSize + 1. If the assembler method returns less than the
number requested, the size of the fill is known. If it returns the
pageSize+1 items requested, pageSize items are
returned to the client but the client sets the collection
size to pageSize + 1 - with one empty slot at the end. When that
empty item is requested by the client, the next pageSize+1 items
are requested and the process repeats until the assembler returns
less than pageSize+1 items.
The HibernateAssembler implements this dynamic paging
mechanism when you set the page-queries-from-database attribute to
true in the destination's server properties. If you are using an
HQL query sent from the client and the query is a simple query, the
Hibernate assembler attempts to implement a count query by
modifying the query sent from the client.
If you are using a named query, the Hibernate assembler looks
for a query named <original-query-name>.count. If that query
exists, it uses it to compute the size of the paged collection.
Otherwise, it uses the dynamic-sized approach.
I guess I should change
<params>java.util.List</params> for
<params>java.util.List,int,int</params>.
But I don't know which properties to add or modify.
It also talks about the custom attribute of the paging
element. Is it a new attribute that replaces "enabled" ? Or does it
come in addition to it ?
The following files are working and allow me to retrieve the
datas I expect (but without paging).
My data-management-config.xml looks like this :
<?xml version="1.0" encoding="UTF-8"?>
<service id="data-service" class="flex.data.DataService"
messageTypes="flex.data.messages.DataMessage">
<adapters>
....<adapter-definition id="java-adapter"
class="flex.data.adapters.JavaAdapter" default="true"/>
</adapters>
<default-channels>
....<channel ref="my-rtmp"/>
</default-channels>
<destination id="refacteur.hibernate">
....<adapter ref="java-adapter" />
....<properties>
........<use-transactions>true</use-transactions>
........<source>flex.data.assemblers.HibernateAssembler</source>
........<scope>application</scope>
........<metadata>
............<identity property="cleacteur"/>
........</metadata>
........<network>
............<session-timeout>20</session-timeout>
............<paging enabled="false" pageSize="20"/>
............<throttle-inbound policy="ERROR"
max-frequency="500"/>
............<throttle-outbound policy="REPLACE"
max-frequency="500"/>
........</network>
........<server>
............<hibernate-entity>fr.phylum.referentiel.Refacteur</hibernate-entity>
............<fill-method>
................<name>fill</name>
................<params>java.util.List</params>
............</fill-method>
............<fill-configuration>
................<use-query-cache>true</use-query-cache>
................<allow-hql-queries>true</allow-hql-queries>
............</fill-configuration>
........</server>
....</properties>
</destination>
</service>
This is the named query definition I use, found in
Refacteur.hbm.xml :
<query name="refacteur.where.ville.order.by.libacteur">
....<![CDATA[
........from Refacteur as refacteur
........where refacteur.villeActeur = ?
........order by libacteur
....]]>
</query>
And here is the call to the fill method, found in my mxml
application file Acteurs.mxml :
globalFilter.dataService.fill(globalFilter.arrayCollection,
"refacteur.where.ville.order.by.libacteur", ["VANNES"]);
I have tried to modify several things, but nothing works.
I would be most grateful if someone could tell me what to
change in my files in order to make the paging work.
Nathalie.Have you seen the part of the example configs where it talks
about what is required for data paging to work?
<!--
Indicates whether data paging is enabled for the destination
and if you wish to override the
pageSize set for the channel.
Setting the custom flag to true indicates that the
associated assembler has a paged-fill method
corresponding to each method specified via the
<fill-mathod> tag. The paged-fill method
should have two additional java.lang.Integer params at the
end of the parameters specified
via the <params> tag. The first param specifes the
index in the fill collection from which this
method will start retrieving records. And the second param
specifies the number of records to be
retrieved by each paged-fill call.
Default enabled value is false. Default pageSize value is
10. Default custom value is false.
<paging enabled="true" pageSize="5" custom="true"/>
-->
It seems to imply to me that you need the paged fill methods
in your config in addition to the regular ones.
I admit I have not got as far as getting a working paging
setup yet, although this is something I will need to get working in
the near future. -
Weblogic security & EJB role based access
How does (or not) weblogic security tie into the EJB notion of role based
control ? Can we create a 'custom' security mechanism for EJB (which
basically uses the EJB facilities but extends it within the application) by
using custom weblogic realms ?
Thanks
RajuThanks !
"Terry" <[email protected]> wrote in message
news:[email protected]...
comments inline
r <[email protected]> wrote in message
news:[email protected]...
>>
Here are some more specific questions around an 'example' scenario:
The application has an entity bean 'Account' that can be accessed by the
roles 'Bank Employee' and 'Customer'
'Bank Employee' can execute the 'getBalance()' and 'placeOnHold()'
methods on the 'Account' bean
'Customer' can execute the 'withdraw()', 'deposit()', and'getBalance()'
methods on the 'Account' bean
These permissions are set up through the deployment descriptor by
mapping
the 'Bank Employee' and 'Customer' roles
to the particular bean methods that the role should be given access to.
1. How does weblogic provide the facility to map the EJB deployment
descriptor
<security-role> to a particular weblogic principal (user orgroup)
Or, should I say, how do I map the user or group to a
deployment-descriptor defined role?In the deployment tool, once in the jar select the 'Security' item,create
an application role (in your case it is probably best to create 2 security
roles - the bank employee role refering to the bank employee group (usethe
'in role' checkboxes, and the customer role refering to the customergroup -
there may at some point be use for an allUsers role, which includes both
groups, maybe not. What I am saying is that a role is made of a one ormore
of Principals - in our case groups)
In the Account Bean select the method permissions item, and create amethod
permission perm-0, select the perm-0 item that has just popped up in the
left hand window, tick the box for placeOnHold(), and the boxes for<remote>
and <home> one level deeper than this in the tree (as an aside, I have
absolutely no idea why there would be a 'home' box here, ho hum). Selectthe
'bank employee' 'can invoke' tickbox
Create perm-1, and do what you did above for 'withdraw()' and 'deposit()'
methods, and the 'customer' tickbox
I believe the documents say you would have to set up another permission to
allow both groups access to the getBalance method, but in practive Ihaven't
found this the case.
The documentation for this is at
http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_deploy.html#1102211
(or
search for 'Deploying EJBs with DeployerTool'
2. Are there any administrative tools provided by weblogic to do
this
mapping ?The deployer tool. Otherwise I think it's the acse of writing your own xml
files
3. How much effort & complexity is involved in creating a custom
realm
Hmmm, depends - you could have the RDBMSRealm that is provided in'examples'
in half an hour or so (there is a problem with one of the RDBMSUser's
methods - getUserType or something like that - the solution can be foundin
the newsgroups if you search), the same is probably true of the LDAPRealm,
NTRealm etc (although I have never used these).
Which one you choose depends on what equipment you have available,although
I would say that the RDBMSRealm canuse a lot of optimisation
Thanks,Welcome
Raju
"Terry" <[email protected]> wrote in message
news:[email protected]...
The Principals (i.e. groups and users) from your custom realm are used
to
define application roles for the EJBs, but, as far as I am aware youcannot
use a custom implementation for the ACLs for EJBs
terry
r <[email protected]> wrote in message
news:[email protected]...
How does (or not) weblogic security tie into the EJB notion of rolebased
control ? Can we create a 'custom' security mechanism for EJB (which
basically uses the EJB facilities but extends it within the
application)
by
using custom weblogic realms ?
Thanks
Raju -
Help with jpa paging exception
hi i have the following method that does paging in an ejb. (dont mind the string params, not using them yet)
@Override
public List<DatamainMst> findAll(String srchCallup, String srchSurname, String srchOthernames, String srchInst, String srchCourse,int first, int pagesize) {
List<DatamainMst> mst = em.createQuery("select o from DatamainMst o")
.setFirstResult(first).setMaxResults(pagesize).getResultList();
return mst;
my database table has about 61868 records. the whole paging works well until "first" argument is 61200, and irrespective of the page size, i always get the following exception:
WARNING: java.lang.NullPointerException
at nysc.entities.DatamainMst._persistence_set(DatamainMst.java)
at org.eclipse.persistence.internal.descriptors.PersistenceObjectAttributeAccessor.setAttributeValueInObject(PersistenceObjectAttributeAccessor.java:46)
at org.eclipse.persistence.mappings.DatabaseMapping.setAttributeValueInObject(DatabaseMapping.java:1367)
at org.eclipse.persistence.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1258)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:331)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:660)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally(ObjectBuilder.java:582)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:551)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:491)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:443)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:635)
at org.eclipse.persistence.queries.ReadAllQuery.registerResultInUnitOfWork(ReadAllQuery.java:838)
at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:464)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:997)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:675)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:958)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:432)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1021)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2857)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1225)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1207)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1181)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:453)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:681)
at com.nysc.setup.MobilizedEJB.findAll(MobilizedEJB.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1056)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1128)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5292)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5264)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5252)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
at $Proxy139.findAll(Unknown Source)
at com.nysc.view.MobilizedMBean.populateLazyDatamain(MobilizedMBean.java:46)
at com.nysc.view.MobilizedMBean.access$000(MobilizedMBean.java:21)
at com.nysc.view.MobilizedMBean$1.load(MobilizedMBean.java:64)
at org.primefaces.component.datatable.DataTable.loadLazyData(DataTable.java:644)
at org.primefaces.component.datatable.DataHelper.decodePageRequest(DataHelper.java:53)
at org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:47)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:790)
at javax.faces.component.UIData.processDecodes(UIData.java:980)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:472)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:175)
at javax.faces.component.UIData.visitTree(UIData.java:1194)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1457)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1457)
at javax.faces.component.UIForm.visitTree(UIForm.java:324)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1457)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1457)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:368)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:246)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:179)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:939)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
WARNING: A system exception occurred during an invocation on EJB MobilizedEJB method public java.util.List com.nysc.setup.MobilizedEJB.findAll(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,int,int)
javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:5119)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:5017)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4805)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2004)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1955)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:198)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
at $Proxy139.findAll(Unknown Source)
at com.nysc.view.MobilizedMBean.populateLazyDatamain(MobilizedMBean.java:46)
at com.nysc.view.MobilizedMBean.access$000(MobilizedMBean.java:21)
at com.nysc.view.MobilizedMBean$1.load(MobilizedMBean.java:64)
at org.primefaces.component.datatable.DataTable.loadLazyData(DataTable.java:644)
at org.primefaces.component.datatable.DataHelper.decodePageRequest(DataHelper.java:53)
at org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:47)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:790)
at javax.faces.component.UIData.processDecodes(UIData.java:980)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:472)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:175)
at javax.faces.component.UIData.visitTree(UIData.java:1194)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1457)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1457)
at javax.faces.component.UIForm.visitTree(UIForm.java:324)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1457)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1457)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:368)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:246)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:179)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:939)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at nysc.entities.DatamainMst._persistence_set(DatamainMst.java)
at org.eclipse.persistence.internal.descriptors.PersistenceObjectAttributeAccessor.setAttributeValueInObject(PersistenceObjectAttributeAccessor.java:46)
at org.eclipse.persistence.mappings.DatabaseMapping.setAttributeValueInObject(DatabaseMapping.java:1367)
at org.eclipse.persistence.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:1258)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:331)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:660)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally(ObjectBuilder.java:582)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:551)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:491)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:443)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:635)
at org.eclipse.persistence.queries.ReadAllQuery.registerResultInUnitOfWork(ReadAllQuery.java:838)
at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:464)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:997)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:675)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:958)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:432)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1021)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2857)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1225)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1207)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1181)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:453)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:681)
at com.nysc.setup.MobilizedEJB.findAll(MobilizedEJB.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1056)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1128)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5292)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:139)
at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5264)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5252)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
... 55 more
i dont know what the problem is, it seems like an eclipse link problem?
what can i do?Well look at the generated code and if you can fix it. The code generator might have a bug so it will be worth reporting it in the bugs database of the netbeans website.
But I would advise you to do the proper thing: don't generate code. Generate getters and setters, but don't let the entire entity be generated. Do the mappings yourself, determine for yourself where you need bi-directional mappings (hint: as little as possible). Make sure that you do EAGER and LAZY initialization in the proper places. Fine tune the nullable,insertable,updateable flags to help the ORM generate the most efficient (and correct) queries possible.
In other words take control, don't let the tool be in control. -
Want to sort tables inside a complex mechanism, what can be the approac
I have a situation where first we are fecthing some ids(list of say version ids using hibernate form database)
then keeping those list of data in a Pager Object(Paging mechanism displays 100 rows per page out of complete sa 100 or so.)
This pager class does two things one takes whole list of ids (Collection of version_id).
(Every time based on search criteria it changes. For searching in hibernate values are hardcoded. Want modification with minimal changes as many things are interrelated here.)
and other thing it checks no. of contents based on that displays data per page(100 here).
It means stores all data from database and send it oage by page.(First thing to notice)
Next all this is getting stored in Report page where it searches other column names based on ids(version_id) the other column names are getting changed for different requests so what we do is take all other columns collectAllExtraFields(this is also getting changed everytime based on what is getting searched.)
Now all this is getting accumulated while displaying but as we know what to display we hardcoded all fields required to display based on search. But all fields are searched based on the id fetched from database first time which Pages is storing.
like this
Search for product user information & retrun results in the form of a paged table for components used by specific product
ComponentVersion versionObj = versionHandler.getComponentVersion(versionId);
String CAUsers = ctHelp.getCAUsersSection(versionId);
tableBody = tableBody + ((i%2 == 0) ? "<tr class='table_banded_row' valign='top'>" : "<tr class='table_row' valign='top'>");
tableBody = tableBody + "<td class='table_data'>" +
procHelper.getCompVersionLink(versionId, versionObj.getCompName(), versionObj.getCompVersion()) + "</td>";
tableBody = tableBody + "<td class='table_data'>" +
CAUsers + "</td>";
tableBody = tableBody + "<td class='table_data'><span class='data'>" +
versionObj.getComponent().getType() + "</span></td>";
tableBody = tableBody + "<td class='table_data'><span class='data'>" +
versionObj.getComponent().getVendor() + "</span></td>";
tableBody = tableBody + "<td class='table_data'><span class='data'>" +
versionObj.getRecommendationType() + "</span></td>";
tableBody = tableBody + "</tr>";
/** Get ComponentVersion ID with hyperlink to ComponentVersion Detail page
public String getCompVersionLink(long versionId, String compName, String compVersion){
return "<a class='datalink' title='" + this.getComponentFlyOverText(versionId) + "' href='/techstacks-v2_1/content/components/componentDetail.jsp?versionId=" + versionId + "'>" + compName + " " + compVersion + "</a>";
this is getting called by Report.jsp to display.
As this is getting changed everytime its called form classes not used in jsp directly i think.
Now original objective is to sort all these displayed columns.
If user clicks on any of the column name everything sholud get sorted on that basis.but sholud not call databse for same again by using same id and mapping with any new column name this sholud be done. Paging mechinasm to be used as it is if possible without major changes.
i don't know where to start with as started looking on this code just 2-3 days back only.
VjSorting and paging - two separate issues. Tackle them separately.
Sounds like you've given yourself a problem by embedding all this logic in the JSP itself. That makes a mess. If you had a front controller servlet that could help you out that would make the page easier.
I think your difficulties are caused by a bad design.
Do your sorting by putting data structures into request scope on the page and make the sort requests back to the page itself. Rearrange the data, then display.
The paging issue is separate. Set the fetch size and have a server-side component that helps with the paging.
% -
Want to sort tables inside a complex mechanism, what can be the approach?
I have a situation where first we are fecthing some ids(list of say version ids using hibernate form database)
then keeping those list of data in a Pager Object(Paging mechanism displays 100 rows per page out of complete sa 100 or so.)
This pager class does two things one takes whole list of ids (Collection of version_id).
(Every time based on search criteria it changes. For searching in hibernate values are hardcoded. Want modification with minimal changes as many things are interrelated here.)
and other thing it checks no. of contents based on that displays data per page(100 here).
It means stores all data from database and send it oage by page.(First thing to notice)
Next all this is getting stored in Report page where it searches other column names based on ids(version_id) the other column names are getting changed for different requests so what we do is take all other columns collectAllExtraFields(this is also getting changed everytime based on what is getting searched.)
Now all this is getting accumulated while displaying but as we know what to display we hardcoded all fields required to display based on search. But all fields are searched based on the id fetched from database first time which Pages is storing.
like this
Search for product user information & retrun results in the form of a paged table for components used by specific product
ComponentVersion versionObj = versionHandler.getComponentVersion(versionId);
String CAUsers = ctHelp.getCAUsersSection(versionId);
tableBody = tableBody + ((i%2 == 0) ? "<tr class='table_banded_row' valign='top'>" : "<tr class='table_row' valign='top'>");
tableBody = tableBody + "<td class='table_data'>" +
procHelper.getCompVersionLink(versionId, versionObj.getCompName(), versionObj.getCompVersion()) + "</td>";
tableBody = tableBody + "<td class='table_data'>" +
CAUsers + "</td>";
tableBody = tableBody + "<td class='table_data'><span class='data'>" +
versionObj.getComponent().getType() + "</span></td>";
tableBody = tableBody + "<td class='table_data'><span class='data'>" +
versionObj.getComponent().getVendor() + "</span></td>";
tableBody = tableBody + "<td class='table_data'><span class='data'>" +
versionObj.getRecommendationType() + "</span></td>";
tableBody = tableBody + "</tr>";
/** Get ComponentVersion ID with hyperlink to ComponentVersion Detail page
public String getCompVersionLink(long versionId, String compName, String compVersion){
return "<a class='datalink' title='" + this.getComponentFlyOverText(versionId) + "' href='/techstacks-v2_1/content/components/componentDetail.jsp?versionId=" + versionId + "'>" + compName + " " + compVersion + "</a>";
this is getting called by Report.jsp to display.
As this is getting changed everytime its called form classes not used in jsp directly i think.
Now original objective is to sort all these displayed columns.
If user clicks on any of the column name everything sholud get sorted on that basis.but sholud not call databse for same again by using same id and mapping with any new column name this sholud be done. Paging mechinasm to be used as it is if possible without major changes.
i don't know where to start with as started looking on this code just 2-3 days back only.
VjSorting and paging - two separate issues. Tackle them separately.
Sounds like you've given yourself a problem by embedding all this logic in the JSP itself. That makes a mess. If you had a front controller servlet that could help you out that would make the page easier.
I think your difficulties are caused by a bad design.
Do your sorting by putting data structures into request scope on the page and make the sort requests back to the page itself. Rearrange the data, then display.
The paging issue is separate. Set the fetch size and have a server-side component that helps with the paging.
% -
Server side paging hughe tables.
Hi,
If I want to do a findAll () on a serious big table (million records), I need a paging mechanism, to avoid an out of memory exception.
This table has a primary key consisting of one (String) field, so no complex stuff there. Is there any easy way to do this with ejbql? I'm using weblogic 6 as the application server.
Cheers.forget about ejbql...
ejbql is not good solution for big table
use fast lane pattern, and directly access database.
This is oracle example.
oracle hint and inline view and good index is key point.
String query= "select "+REQUEST_LIST_SELECT+" from "+TABLE_SERVICE_REQUEST +","+
" (select /*+ INDEX_DESC("+TABLE_SERVICE_REQUEST+" "+INDEX_SERVICE_REQUEST+")*/ "+
" ROWNUM NUM,SERVICE_CODE from "+TABLE_SERVICE_REQUEST+
" where ROWNUM<="+(offset+numberPerPage)+
getServiceRequestWhere(searchStart,searchEnd,keyward)+
" ) indexer "+
" where NUM>"+offset+" and indexer.SERVICE_CODE="+TABLE_SERVICE_REQUEST+".SERVICE_CODE "+
" order by SERVICE_CODE desc"; -
Performance degraded with VirtualListView control
Hi,
We are using VirtualListView control for retrieving LDAP entries from SunOne directory server. We observed that with VirtualListView control, search performance degraded considerabaly (almost down by 95%) as compared to retrieving same result without using Paging mechanism.
We have configured the directory server for better performance. Also added the index on attributes which we are retrieving using search operation. But still performance is very bad. Does any one has faced this issue earlier? Are there any settings which we can use to improve the performance?
We do not want to retrieve all records without using paging to avoid any memory issue.
Thanks,
Kiran"Do i need to some setting adjustments ?"Probably not.
"The performace degraded drastically."Could you elaborate a bit more please? Could you give an example please?
/r -
Difference b/w Java Class and Bean class
hi,
can anybody please tell me the clear difference between ordinary java class and java Bean class. i know that bean is also a java class but i donno the exact difference between the both.
can anybody please do help me in understanding the concept behind the bean class.
Thank u in advance.
Regards,
FazlinaWhile researching this question, I came across this answer by Kim Fowler. I think it explains it better than any other answer I have seen in the forum.
Many thanks Kim
Hi
Luckily in the java world the definition of components is a little
less severe than when using COM (I also have, and still occasionaly
do, worked in the COM world)
Firstly there are two definitions that need to be clarified and
separated: JavaBean and EnterpriseJavaBean (EJB)
EJB are the high end, enterprise level, support for distributed
component architectures. They are roughly equivalent to the use of MTS
components in the COM/ COM+ world. They can only run within an EJB
server and provide support, via the server, for functionality such as
object pooling, scalability, security, transactions etc. In order to
hook into this ability EJB have sets of interfaces that they are
required to support
JavaBeans are standard Java Classes that follow a set of rules:
a) Hava a public, no argument constructor
b) follow a naming patterns such that all accessor and modifier
functions begin with set/ get or is, e.g.
public void setAge( int x)
public int getAge()
The system can then use a mechanism known as 'reflection/
introspection' to determine the properties of a JavaBean, literally
interacting with the class file to find its method and constructor
signatures, in the example above the JavaBean would end with a single
property named 'age' and of type 'int' The system simply drops the
'set' 'get' or 'is' prefix, switches the first letter to lower case
and deduces the property type via the method definition.
Event support is handled in a similar manner, the system looks for
methods similar to
addFredListener(...)
addXXXListener
means the JavaBean supports Fred and XXX events, this information is
particularly useful for Visual builder tools
In addition there is the abiliity to define a "BeanInfo' class that
explicitly defines the above information giving the capability to hide
methods, change names etc. this can also be used in the case where you
cannot, for one reason or another, use the naming patterns.
Finally the JavaBean can optionally - though usually does - support
the Serializable interface to allow persistence of state.
As well as standard application programming, JavaBeans are regularly
used in the interaction between Servlets and JSP giving the java
developer the ability to ceate ojbect using standard java whilst the
JSP developer can potentially use JSP markup tags to interact in a
more property based mechanism. EJB are heaviliy used in Enterprise
application to allow the robust distribution of process
HTH.
Kim -
Working with VERY LARGE tables - is it possible to bypass row counting?
Hello!
For working with large result sets ADF provides the `Range Paging` mechanism for views, described in the 27.1.5 part of the Developer’s Guide For Forms/4GL Developers.
It works well, but as a common mode it counts total row count to allow paging. In some cases query `select count(1) from (SELECT ...)...` can take very, very long time.
But if a view object doesn't know row count (for example we can override getEstimatedRowCount() method ), paging controls doesn't appear in user interface.
Meanwhile I suggest that it's possible to display two paging links - Prev and Next, without knowing row count. Is it a way to do it?
Thank in advance,
Ilya Rodionov.Hi Ilya,
while you wait for Franks to dig up the right sample you can read this thread:
Re: ADF BC: Performance issue with getEstimatedRowCount (ER?)
There we discuss the exact issue.
Timo -
Equivalent of alloc_oages in solaris 10
Hi All,
Currently iam porting my linux 10 gig network driver into solaris .
I have a question regarding Memory allocation ,
1. For performance tuning we directly allocate pages in linux
( using alloc_pages) and just unmap them ( using pci_umap)
Is there any equivalent in solaris .
2. Is there any sample driver which implemented this paging
mechanism .
RamyaThank you alan
even after setting the max file descriptor to 8192, the output from pfiles show as 4096
Current rlimit: 4096 file descriptors
would you know if there is something wrong with the command which i am using - projmod -s -K 'process.max-file-descriptor=(basic,8192,deny)' PROJECTNAME( I am issuing this command as root)
thank you
Jonu Joy -
Hi
I am a student and I have to write a report on Java Beans and RMI and I am a little confused on the diferent terminology and was hoping that someone could help me out. Here is what I can gather from reading all the info that I have found so far.
When talking about a JavaBan it refers to a Java Class designed to conform to the JavaBean specification that turns them into a re-usable software component that can be used in application builders. Generally these are graphical type GUI tools like enhanced test boxes etc, that are used to build client side GUIs, but they don't have to be. Any Java class can be turned into a Bean as long as it conforms to the Bean specification, so this means that a class that encapsulates some type of business logic could also be turned into a bean. Is this correct?
Java RMI is another specification that allows beans to become remotely accessble objects, used for distributed computing. This is where I become unstuck. Do the beans need to be re-written to conform to the RMI specification or is the RMI object seperate to the Bean? Can you use a standard Javabean as a distributed object?
How do Enterprise JavaBeans fit into all this?
If anyone can explain this to me I would be geatly appreciated.
Regards
AndrewI am myself a beginner in that technology so that I'll respond with the best of my knowledge.
Any Java class can be turned into a
Bean as long as it conforms to the Bean specification,
so this means that a class that encapsulates some type
of business logic could also be turned into a bean. Is
this correct?
Yes.
Java RMI is another specification RMI isn't only a specification. It's a technology/API that lets you execute on a local computer code that is on another (remote) computer through the network. It's a java-specific RPC (Remote Procedure Call) mechanism.
that allows beans to
become remotely accessble objects, used for
distributed computing.
Do the beans need to be re-written to conform to the
RMI specification or is the RMI object seperate to the
Bean? Can you use a standard Javabean as a distributed
object?
How do Enterprise JavaBeans fit into all this?
If anyone can explain this to me I would be geatly
appreciated.
Regards
AndrewRMI itself doesn't require that remotely accessible objects are beans and doesn't prevent them to be so. It isn't much more than a transport and communication mechanism.
EJB is quite different because it's a design and architecture specification for client-server and distributed applications. EJB can be implemented using RMI or using other transport and communication systems, like CORBA.
Maybe you are looking for
-
Interactive form generation issue
Hi All, We created an application which generates an Adobe Interactive PDF forms. This was working fine previously, but now while generating the PDF it is taking a very long time ....10-15 minutes and after that it is giving the session timeout error
-
Can you sign into Adobe CreatePDF from different desktops?
I am looking into purchasing Adobe CreatePDF for administrative work that I do for my job. The problem is that I don't have a set work station and am changing desktop computers in the office frequently. I was wondering if I can sign into Adobe Create
-
Hi When executing TCode ABST2, the below msg displays: Differences between assets and G/L accts in the balance carried forward Message no. MQ555 Diagnosis Differences occurred in the balance carried forward when comparing asset summary records and G/
-
Standalone Installation of Oarcle 10.1.2.3 Form and Reports
Hi, We are planning to install Oracle 10g AS only with forms and reports on OEL 5.3. Please suggest steps to install the same. Thank you in advance, Regards, Satish
-
Create and save a BuilMktAttribute entity in a report?
Hi all, I've to do a mass import of marketing attributes from a flatfile to some business partners. I try to do this using the BOL (see test coding below). All values are submitted to the BOL entity and corresponding to the values of the tables KLAH,