cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing oracle database using EJB as a web service

Former Member
0 Kudos

Hi Friends,

i'm accessing external oracle database through EJB as a web service. i have created methods which returns java.sql.Connection and java.util.Hashtable. But it doesn't allow me to add these methods to the web service.

Can anyone please help and solve this problem.

Thanks in advance...

Akshay

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

1.4 GB of memory is a bit high.

Try this link.It has some steps to optimise your server.

http://help.sap.com/saphelp_nw04/helpdata/en/b5/7e1141e109ef6fe10000000a1550b0/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/bb/fdc4402418742ae10000000a155106/frameset.htm

About the DSN in PrimaVera try to catch the Exception using Exception instead of SQLException.

General Error is very generic.If we can find what is wrong exactly its easier to solve.

Connection pooling is ur best bet. Close ur connections properly as soon as the purpose is solved.

Regards

Bharathwaj

Former Member
0 Kudos

Hi Akshay,

following is the onther solution.

You can do onething.

Make one Java class which implements serializable interface. and this java class contains all fields of your table returned from oracle database. make setter and getter methods for this.

Now, in EJB, create array of objects of this Java class type.

Assign field values to it depending upon rows in your resultset and then return this array as the result.

Regards,

Bhavik

Former Member
0 Kudos

Hi,

ArrayList,HashSet,LinkedList,List,Stack and Vector are the objects supported .

Choosing a Entity Bean depends completely on the scenario.

If u want to model a entire transaction ..

assuming a creditcard transaction just verifying the customers account does not need a entity bean.

But for the whole transaction say from verification to debiting from account we can go for entity beans.

I would rather suggest u to stick with stateless session beans if the scenario is simple.

I find entity beans a bit more complex.If u r good in EJB s its a good bet.

regards

Bharathwaj

Former Member
0 Kudos

Hi Bharathwaj,

Thanks for the reply. it has really helped me a lot.

i wanted to ask one more thing...

In our webdynpro application (deployed on WAS) we are required to fetch and update data in oracle database. The restriction here is we are required to use DSN (provided by Primavera Inc..for connection). We are using connection pool, where we have configured data source with DSN(system DSN) with appropriate parameters.

We have tested the dSN for extensive data transfer from our local jvm's...but when used with J2EE on WAS..its not that stable, when used to transfer data say for more than 2-3 times, gives SQL Exception with general error. Then after, when J2EE engine is stopped...it starts working fine...then again after when J2EE started, same problem occurs...

Is it some problem with memory??

Because our server has 1 GB RAM + 4 GB VM there fore total 5GB available memory. Previous performance of server was very slow due to wrong VM setting...

Now also the performance is not that good...jalunch.exe consumes upto 1.4 gB of memory..is it ok..or something wrong???

Is there alternative best way to talk to external oracle database from WAS J2EE...or connection pool is the best possible method..

If there are any settings to be done on server also..

fine..we have complete access of it...

Please help..

Former Member
0 Kudos

Hi,

Only objects that can be serialized can be used in WS endpoint.

As connection is not a serializable object(its transient), we cant use it. And Hashtable is not supported in Web Services. You can use arraylist,hashset or vector.

Regards

Bharathwaj

Former Member
0 Kudos

Hi Bharathwaj,

Can i use HashMap instead of HashSet...is it supported in Web Services?

One more thing is that im accessing the database using stateless session bean. Should i use Entity bean because what i have studied is that it is used for persistent data and in my scenario im accessing data from external database. so everytime i fire a query the data will get changed.

Will use of stateful session bean be appropriate?

Please help...

Thanks in advance...

Akshay