Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Ghulam Rashid

Ranch Hand
+ Follow
since Jan 14, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ghulam Rashid

I want to display "Warning: Page has Expired" message after 2 mins of browser idle time. I have enabled following setting in my httpd config.

<IfModule mod_headers.c>
Header append Cache-Control: "private, max-age=120"
</IfModule>

I can see my web page is created in "Temporary Internet Files" with proper expired time i.e. mypage.jsp expires on 08/28/2007 10.23AM which was last access at 10.21 AM. But after waiting for 5 minutes when I am clicking on browser's back/forward button page is not expiring and even it displays the data from the cache.

Can someone suggest why page is not expiring? Waht I should do?

Thanks
12 years ago
Originally posted: 2007 Aug 16 01:32 PM
raj12345 Post new reply

Subject : Need to enable Cache expiration on browser through IHS - IBM HTTP Server

In my existing application there are around 200 JSPs pages. In some JSPs, we are setting cache expiration time in the header. And for the remaining JSPs, we want to enable cache expiration on the IHS without touching the code. Below is my questions.

1. Is there a way to enable cache expiration on IHS? Probably Yes.
2. If YES, how can we retain/preserve cache expiration, set by application? i.e. if JSPs has cache expiration time use that time or IHS will set the cache expiration time on the JSPs.

Please suggest.
12 years ago
Off course not. My emphasis was on reusing the below code.
queueConnection = queueConnectionFactory.createQueueConnection();
queueConnection.start();
My application has JMS performance issue, by EOD we run into out of connection. Below is the code, which is called for every request. I definitely have to reuse some piece of code.

try
{
queueConnection = queueConnectionFactory.createQueueConnection();
queueConnection.start();

queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queueSender = queueSession.createSender(queue);
message = queueSession.createTextMessage();
message.setText("This is a sample JMS message.");
System.out.println("Sending message: " + message.getText());
queueSender.send(message);

}
catch (JMSException e)
{
System.out.println("Exception occurred: " + e.toString());
}



Do, we really need to call
queueConnection = queueConnectionFactory.createQueueConnection();
for every request. I am thinking to cache and reuse below line of code.

queueConnection = queueConnectionFactory.createQueueConnection();
queueConnection.start();

Also, I am thinking to reuse JMS Session, rather than creating for every request.

Any thought will be appreciated.

Thanks
Congrates Jezreel.

Could you please let me know, how much time it took for Part 2 and 3 preparation. Also, suggest some material/link for Part 2 and 3.

Thanks
I cleared part 1 in may 2005 and called sun to find out whether my part 1 is still valid or not. And, I have been told yes I can proceed with Part 2 and 3. Before, start preparing 2 and 3 i need to plan. Could someone tell me how much time it will take to clear 2 and 3. Right now, I am involved in desiging and architeching and different roles in the project. My concept about UML and others topics are very much clear.

Thanks
Rashid
In plain class (POJO) the data type is java.lang.String. And, in mapping it is text. But, this is for CLOB column.

Probably, for your LONG type you can map with big_decimal in mapping and in pojo you can use java.math.BigDeciml. Probably that may help.

Thanks
Rashid
I am able to get the data from CLOB. I had to made changes in the mapping and pojo to change the data type.
I changed the clob type to text (hibernate type) which is java equivalent "Very Long Strings"/java.lang.String.

mapping.xml
-------------
<property name="clobData" type="text/string">
<column name="ClobData" />
</property>

But, I am still unable to figure out why clob hibernate type is not supported. There is ClobImpl class and org.hibernate.type.ClobType
in hibernate but do not have enough time to run into hibernate jungle.

I hope i wont lose data using text/string.

Thanks
Correction to HQL
String clobHQL = "from ClobPOJO";
Hibernate Code - Reading CLOB Data
----------------------------------------------------------------------------------------------------------------------------------
mapping.xml
-------------
<property name="clobData" type="clob">
<column name="ClobData" />
</property>

java code
---------
String clobHQL = "from ClobTest";
Query query = session.createQuery(clobHQL);

List result = query.list();

ClobPOJO clobPOJO = (ClobPOJO)result.get(0);
java.sql.Clob dataAsClob = clobPOJO.getClobData();

// FIRST WAY - Error
String dataAsString=dataAsClob.getSubString(1, (int) dataAsClob.length());

// SECOND WAY - Error
Reader reader=dataAsClob.getCharacterStream();
CharArrayWriter writer=new CharArrayWriter();
int i=-1;

while ( (i=reader.read())!=-1)
{
writer.write(i);
}

String dataAsString = new String(writer.toCharArray());


Error
========
java.io.IOException: [PWS0001] Function did not complete successfully.
at com.ibm.as400.access.AS400JDBCInputStream.read(AS400JDBCInputStream.java:305)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:200)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:239)
at java.io.BufferedInputStream.read(BufferedInputStream.java:294)
at com.ibm.as400.access.ConvTableReader.fillCache(ConvTableReader.java:180)
at com.ibm.as400.access.ConvTableReader.read(ConvTableReader.java:500)
I am wondering if we can tell hibernate to start incrementing the number for id column e.g. from 500 or any other, if we use <id> <generator class="increment"/>

Currently, my table is empty.

Any idea ?
I have configured my application to use log4j. When I am turning to info and stdout level ... it is logging all the hibernate logging message which is DEBUG/INFO, which I dont care but I care my application logging stuffs i.e. all message set to INFO/DEBOG etc

Could some one help me on how to disable hibernate logging when using log4j.

Thanks
I could not find the create profile wizard. Could you please give some info regarding launching create profile wizard.

Thanks
13 years ago
I am working on RAD 6.0 and currently there is only one default profile. I do not have separate WAS installation, RAD has inbuild Websphere server.

I am trying to create one more profile. I issued the following command from the command line (windows) but its giving the error.


wasprofile -create
-profileName myprofile
-profilePath "C:\Application\custom_profile "
-templatePath "C:\Program Files\IBM\Rational\SDP\6.0\runtimes\base_v6\profileTemplates"
-nodeName GSO0495809DNode01
-cellName GSO0495809DNode01Cell
-hostName localhost

<Error>
------------
The available modes are: create, augment, delete, unaugment, deleteAll, listProfiles, getName, getPath, validateRegistry, validateAndUpdateRegist
ry, help
For detailed help on each mode enter: -<mode> -help. For example, -create -help.
Command line arguments are case sensitive.

I was also trying to explore the possibility for creating the profile from the RAD itself. Window -> Preferences -> Server ...... but could not found any option for creating profile.

Any suggestions are welcome.

Thanks
Rashid
13 years ago
I am trying to figure out the equivalent of Weblogic Startupup class feature on Websphere. I need to call some plain java class(not deployed on server) when websphere app server starts up.. Any idea, anything equavalent to this. How to kick off plain java class using the websphere inbuilt feature ....
Any suggestion would be appreciated ........
13 years ago