greptilian logo

IRC log for #friendlyjava, 2017-08-17

##friendlyjava on freenode

| Channels | #friendlyjava index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
04:46 philbot joined ##friendlyjava
04:46 Topic for ##friendlyjava is now Be friendly :) This channel is publicly logged at http://irclog.greptilian.com/friendlyjava/today
05:03 df0_ joined ##friendlyjava
06:42 foojs joined ##friendlyjava
06:59 mr_lou joined ##friendlyjava
07:15 abba joined ##friendlyjava
08:07 kirua joined ##friendlyjava
08:07 kirua hi
08:07 kirua how are you guys ?
08:18 aditsu not too bad
08:30 kirua how is life in HK ? you own your own company there ? i heard it's good place to start your company
08:34 kirua here is the situation i'm confronted to : i need to develop a webservice that is going to retrieve a list  of elements from a database and send it back via a webservice.  For example the webservice' client asks for the list of commands made between date A and date B. The list can contain several millions elements, which creates two problems,  1) execution speed (the whole process takes a long time to perfom) 2) memory issue (the app runs on a
08:34 kirua jvm with 1gb RAM). When the query returns 100 000 elements, it works fine but when it has to return several millions, it runs out of memory..
08:34 kirua So i'm trying to retrieve the data in chunks and write to a file and then stream it to the client, but i'm still running out of memory, i guess it's because the jvm has to read the entire file in memory in order to append to it ! :(  How to do it, do you have any advice or idea so i can solve this issue because i'm stuck
09:11 aditsu kirua: yeah I have a company, but just a 1-man team so far :p and not sure how good it is to start here, since the political climate is getting worse
09:12 aditsu kirua: I don't think you need to use files, just stream the results to the client
09:12 kirua i guess it's will stay better than romania tho
09:14 aditsu well, at least it's simpler and better organized, I think
09:14 kirua how to stream it ? can you suggest me a java class so i'll look deeper into it.  i found an example on how to stream a file with  jax-ws (https://www.mkyong.com/webservices/jax-ws/jax-ws-attachment-with-mtom/)        that's why imtrying to write to a file, that i can stream later
09:14 kirua yeah a lot of bs and bad people in romania unfortunatly
09:15 aditsu I don't know anything about jax-ws
09:15 aditsu are you from Romania?
09:16 kirua no, but i met a lot of romanians.
09:19 aditsu at the most basic, bare-bones level, you could do what you want with servlets and JDBC - iterate through the ResultSet and write the results to the servlet's output stream
09:22 aditsu just make sure the result set is not cached
13:55 mr_lou joined ##friendlyjava
14:38 df0_ joined ##friendlyjava
15:47 mr_lou joined ##friendlyjava
16:07 Guest70103 joined ##friendlyjava
17:25 kirua joined ##friendlyjava
18:51 kirua joined ##friendlyjava

| Channels | #friendlyjava index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

##friendlyjava on freenode