vivek srivastav

Greenhorn
+ Follow
since Nov 03, 2004
Merit badge: grant badges
For More
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 vivek srivastav

Chris,
I went for the JBoss for Advanced J2EE developer training last week as I am also planning to get certified as a JBoss Consultant/Developer. The course content was pretty much geared towards JBoss architecture and design, viz the Microkernal design, classloader, service management, smart proxies, JBoss Cache and invokers bindings. There was very little discussions on EJB as such. I found the course very helpful. But it's helpful only if you want to understand details of how JBoss works, possabily troubleshoot it and tune and optimize it.
Regards,
Vivek
------------
SCEA
I am doing something like this to delete old records. I am not sure if it is the right approach. I am kind of worried about the finder returning too big a collection object. What should I do? :confused

/**
* @ejb.interface-method
* @param olderThan
* @throws CrystalException
*/
public void PurgeAudits(int olderThan) throws CrystalException {
try{
Context initial = new InitialContext();
Object objref = initial.lookup(AuditLocalHome.JNDI_NAME);
AuditLocalHome home = (AuditLocalHome)PortableRemoteObject.narrow(objref,AuditLocalHome.class);
long l = System.currentTimeMillis() - olderThan*24*60*60*1000;
SimpleDateFormat dfmt = new SimpleDateFormat("MM/dd/yy 00:00 'AM', z");
String strDate = dfmt.format(new Date(l));
java.util.Date d = dfmt.parse(strDate);
Collection c = home.findByOlderThanDate(d);
Iterator itor = c.iterator();
int i=0;
while(itor.hasNext()){
AuditLocal al = (AuditLocal)itor.next();
//Timestamp ts = (Timestamp)al.getPrimaryKey();
//if(ts.before(d)){
al.remove();
//}
}
} catch (Exception ex) {
ex.printStackTrace();
log("PurgeAudits: "
+ ex.getClass().getName()
+ " :"
+ ex.getMessage());
throw new CrystalException("PurgeAudits: "
+ ex.getClass().getName()
+ " :"
+ ex.getMessage());
}
}
I want to select TOP 10 records from a CMP, is there was way I can write a finder query using EJB QL?
-vivek