Derick Potgieter

Ranch Hand
+ Follow
since Feb 19, 2004
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 Derick Potgieter

Hi All,

I need some help.

I have a web service running in Standard Edition 1.6 on a server. There isn`t a full app server nor is it required except for exposing some functionality.
I decided to use the built in web service container in 1.6 and this is running quite flawlessly. The problem is security, i`m not even sure how to implement it nor if it is possible in 1.6.

Any ideas or someone who has done this before? I need some kind of auth based roles or user/pass access?

I`m a bit new to this so please bear with me.

Rgds
Derick
12 years ago
Hi All,

Quick Q: I need to store a TreeMap in a singleton which is accessible in my application on distributed machines. Any ideas of how i can accomplish this.

The only way i that i guess is functional and usable in a distributed app as well as taking care of Thread safety issues is using a database?

Ideas welcome?

Rgds
Derick
About 0.5kb-5kb, with small bursts over 5kb up to a max of 20kb.

Server specs is a quad core xeon, 16gb ram, san storage as primary volume.

Rgds
D
[ May 27, 2008: Message edited by: Derick Potgieter ]
Thanks for the response!

There is for sure come optimizations that we can do, but i cant see is getting past 10 records a second. It has more to do with the actual processing and amount of processing we are performing. The payload we are using is also quite substantial and unmarshaling this using JAXB plus changes, comparisons, additional lookups and persisting this schema into multiple tables is quite intensive.

I`m really looking here for a mass real-time processing pattern type implementation.

We are using this application in a bank and the size of the data plus volume is quite intense.

We will optimize the application but i still need a way to process this as fast as possible.
Hi All,

Here is a interesting question that i need some different views on.

We have designed a solution (quite common) that uses a timer bean that triggers every 2 min to read data from a database and process it.

The issue is that with the amount of processing we are doing we get a through put of 2/second this includes conversions, extra database writes etc. O CPU utilization in about 2-5% (Huge....huge cluster)

Normally this would not be a issue, but seeing that we receive 5000 records at a 10 in the morning and that all of them are equally important to process right away....we are a bit stuck. (total time +- 45 min)

So....here with my new solution which i need help on:

1. The database we are reading off gets an extra column that sequences the data based on the amount of timers registered.

2. Based on a mbean`s config i start multiple timers.

3. These timers now only read from the database there respective sequence numbers data (timer 3 only read data where the TIMER_SEQUENCE column is 3). and places it on a jms queue with the messageSelector property set to the sequence of the timer.

This basically allows us to process in parallel

4. Multiple MDB`s get registered to listen for there respective messageSelector value and processing happens as normal.

If i`m correct, the only thing i need to configure statically is the MDB`s to listen for there respective messageSelector value. Say from 1 - 10.

If we get multiple messages on the queue (which we are going to get as the multiple timers read and throw jms messages) the MDB`s will scale and create more instances that listen on the same queue and for the same messageSelector property.

Any one with pitfalls and flaws that i have seen....this is quite new to me processing this amount of data as fast as possible.

Any other ideas also welcome.

Thanks
Derick
Hi All,

Could anyone explain to me why i would get this exception in a CMP stateless session bean (Timer). This only happens after a couple of minutes.


INFO: Checking incomming statements for late ones...
13:30:48,798 WARN [AbstractBatcher] exception clearing maxRows/queryTimeout
com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)


Obviously the connection was closed, but why would this happen and how can i solve it?
From what i understand this is the rule

[ April 03, 2008: Message edited by: Derick Potgieter ]
To tell you the truth, the only benefit that i can see is to use that reference in a helper class called from the class where the class level DI was used.

So lets say init looked like this:

HelperClass hc;

public void init(){
hc = new HelperClass();
}

and helper class

public class HelperClass{
AuditService audit;

public HelperClass(){
....
audit = (AuditSevice) initialContext.lookup("audit");
}
}

This allows you to bind a resource injected at runtime to local jndi.

Remember that if you use DI on field level, you can still access it via jndi, it is just the whole class path + "." classname + field name. Using class level di just makes it easier to access that resource.

This is a quote from bea.com


The class-level annotations declare an entry in the application component's environment but do not cause the resource to be injected. Instead, the application component is expected to use JNDI or component context lookup method to lookup the entry. When the annotation is applied to the class, the JNDI name and the environment entry type must be specified explicitly.



Maybe someone else can explain it better....sorry!
Class level injection has more to do with binding a certain object or resource to the local jndi that is easy to reference. This is useful when you need a resource/object in a helper class that is`nt managed.

i.e.
@EJB(name="audit", beanInterface=AuditService.class)
public class .... {
AuditService audit;

@PostConstruct
public void init(){
audit = (AuditService)context.lookup("audit");
}

}
[ April 03, 2008: Message edited by: Derick Potgieter ]
Hi,

Have you found a way to integrate the two?

Rgds
Derick
14 years ago
Hey all,

I`m struggling understanding one of the @Remove annotation on a stateful session bean.

I have a servlet that creates an order + billing + shipping process over a few steps. When i`m done i call the place order method on my remote stateful session bean. This method is annotated with the @Remove tag.

On completion it removes the stateful session bean. This part is fine and dandy, but why when i initiate the process again from scratch (same session) i get an error :
NRU-za.co.test.ejb3.session.PlaceOrderBean: Cannot load from BACKUPSTORE FOR Key: <2d900a2300b91f-ffffffff8ec70191-0>

I understand that the current sessions stateful bean has been removed already, but shouldn`t it create a new stateful bean at this point and rebind it?

Thanks for the help
i get that, but why doesnt this work.

Please can you give me an example of where pass by reference is working.

Integer iInt = new Integer(2);
Integer yInt = iInt;

iInt *= yInt;

System.out.println("iInt : " + iInt);
System.out.println("yInt : " + yInt);

String iString = "grrr";
String yString = iString;

iString += "Whaaaa";


System.out.println("iString : " + iString);
System.out.println("yString : " + yString);

thanks
14 years ago
Hi Guys,

I know this might be a very basic question, but for some reason it isnt behaving they way i thought it should.



The output is :

i : 2
y : 1 (understand, pass by value)
iInt : 2
yInt : 1 (dont understand)
iString : Whaaaa
yString : grrr (dont understand)

Shouldnt the last to be the same as the object they got assigned to. Shouldnt they pass there value by reference, so that when the reference values change, they have the new value?

What am i not getting here.

Thanks
D
14 years ago
Hey guys,

I`m having an issue with ejb3 in my web app (glassfish v2b58c). I think this is more of an architectural issue, but i`m still not sure how to resolve it.

I have a shopping cart app, that displays a menu on the left. This menu is created from querying the database for all the sections and under it categorys of products available (soft of a quick link).

Section 1
-> Category 1
-> Category 2
-> Category 3
Section 2
-> Category 4

If i update a Category the change shows strait away. I guess toplink cache gets updated with the update operation.

if i create a new Category it doesnt show under the sections, i`ve debug the app and what seems to be the problem is that the cached objects under the section selected doesn`t get updates.

Now i`ve added a piece of code to manually refresh the section from the DB, and this fixed the cached category`s under the section aswell.

Now i would have thought that Toplink would recognize the new object being as being a part of the section selected.

Any suggestions would be welcome.

Thanks
Derick