greptilian logo

IRC log for #javaee, 2013-10-01

Please see http://irclog.greptilian.com/javaee for which days have been logged.

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

All times shown according to UTC.

Time S Nick Message
00:19 SoniEx2 joined ##javaee
00:25 ariel__ joined ##javaee
00:26 ariel__ hello
00:26 ariel__ i am from colombia
01:14 SoniEx2 joined ##javaee
01:38 jenue joined ##javaee
02:22 disker joined ##javaee
03:25 bonhag joined ##javaee
03:27 __nh__ joined ##javaee
03:30 jenue joined ##javaee
04:18 Quest joined ##javaee
05:25 grug joined ##javaee
05:53 Quest are there smarter, better or more ways to make JavaEE web app as async in processing other than change each servlet in our app like in this  http://developerlife.com/tutorials/?p=1437 ?
09:31 Quest joined ##javaee
09:31 Quest left ##javaee
11:09 pdurbin I think some frameworks are async by default
12:56 Ubuntivity joined ##javaee
12:56 StanAccy joined ##javaee
12:56 StanAccy left ##javaee
12:57 Ubuntivity Hello
13:02 Ubuntivity What is the difference between Jave SE and Java EE ?
13:05 acuzio Ubuntivity: Quest will be here shortly ask him
13:06 Ubuntivity acuzio: I'll be waiting for Quest then :)
13:08 zhein joined ##javaee
13:09 Fubar^ Ubuntivity: http://docs.oracle.com/javaee/6/firstcup/doc/gkhoy.html
13:21 Naros joined ##javaee
13:57 acuzio Fubar^: But but Quest
14:07 Fubar^ I wondered how hard it was to google it, and that was the first on google for "java se vs ee"
14:07 Fubar^ some people are lazy
14:08 tjsnell like acuzio?
14:09 pdurbin when i wonder how hard it is to google something I use crimsonfubot
14:09 acuzio are you upto you old tricks again tjsnell ?
14:09 pdurbin crimsonfubot: lucky java se vs ee
14:09 crimsonfubot pdurbin: http://docs.oracle.com/javaee/6/firstcup/doc/gkhoy.html
14:09 tjsnell again?
14:09 tjsnell when did I stop?
14:11 acuzio Wheres the op of the channel ?
14:11 acuzio can someone ask tjsnell to stop making personal attacks on TOmcat servers ?
14:12 acuzio I need 16,000 threads
14:12 acuzio why cant Tomcat do that for me ?
14:21 Quest joined ##javaee
14:31 Naros acuzio: it makes no sense for a single process to spawn 16k threads
14:32 Naros at least on hardware which the average corporation can get their hands on and aren't govt contractors :)
14:34 acuzio Naros: nonsense - ask Quest or Guest47243 -  he knows the reason for it
14:34 Naros I understand and have discussed this with him at length yesterday.
14:34 acuzio and ?
14:34 Naros Do you understand CPU thrashing and context switching mechanics?
14:35 Guest47243 as a side note. it was 8 tomcats with 8 * 2000 concurent connections / thread
14:35 acuzio yeah - see
14:35 Naros right but all on one server iirc
14:35 Guest47243 Naros,  I think I have done the code you guided me yesterday
14:35 Guest47243 Naros,  yes
14:35 Naros That's still overtaxing the hardware
14:35 Guest47243 Naros,  ok. now, just to be sure. If aim in controller. and get some entity by serrvice method, it will not give me any lists that were inside that entity object class. (lazy initialization). To get those too. I just need to do getThatList() (just call the getters of sub lists) in service?
14:36 acuzio see Guest47243 has a real example and some real statistics -
14:36 Naros any high availability and multiplexing solution requires a small pool of threads operating in an async decoupled mannor to accept high numbers of connections but decouple and multiplex the I/O in a small pool of threads to maximize throughput.
14:36 acuzio what do you have Naros
14:37 Naros acuzio: At my last job, I worked on the network server layer for an MMO company :P
14:37 Naros we did precisely what I am saying
14:37 acuzio Naros: so what
14:37 Naros single machine handling thousands of connections with ease and didn't require 16k threads
14:38 Naros Just implying your approach isn't practical, even in a high availability and massive throughput scenario is all.
14:39 acuzio my approach
14:39 acuzio ??/
14:39 Naros yours, your company's, Quest's - whoevers.
14:39 acuzio its Guest47243 approach and i am fully behind him on it
14:39 acuzio My company;s ....
14:40 Naros Dude, I'm not going to argue over this.  I'm just saying the approach is impractical, end of story.
14:41 Naros Guest47243: If your entity is tied to a session and the hibernate session only exists while inside the service method, then yes
14:41 Naros generally unless you're using something like open session in view or open entitymanager in view concepts which is generally frowned upon, then yep you must initialize everything in the service tier before you pass the entity to the view
14:42 Naros or else you'll get a lazily load exception
14:42 Guest47243 hm. Naros lazy init is default behavriou. how to contrary that?
14:42 Guest47243 how to make the contrary as defualt. so that it loads all lists , etc by default
14:42 Naros Entity a has a collection of entity B using a @OneToMany annotation which by default is Fetch=LAZY
14:42 Naros that means when Hibernate loads the entity it won't load that collection by default.
14:43 acuzio why not Naros ?
14:43 Naros But if you need that collection, you either 1) need to toggle it as EAGER and apply a transformation to get distinct results or 2) load it in a subquery while the session is loaded.
14:44 Naros EAGER can be specified multitudes of ways depending on whether you're using the Criteria API or HQL
14:44 acuzio I think all of this is wrong-  Guest47243 is right - 8 * 2000 threads on a single machine with lazy loading
14:44 acuzio Naros:  why is it not default ?
14:44 sfisque Quest, are you lurking?
14:44 acuzio sfisque: he is Guest47243
14:44 sfisque gotcha.
14:44 acuzio sfisque: He shredding Naros to pieces
14:45 Naros When you leave a transaction, the hibernate session is generally closed, meaning no more underlying JDBC connection with the DB so the properties which are lazy will not be capable of loading when you access them
14:45 Naros this is ORM 101 :P
14:45 acuzio But thats just bad - why not keep it open all the time ?
14:46 Naros You can if you want to use poor design patterns like OSIV and OEMIV :P
14:46 __nh__ joined ##javaee
14:46 Naros this means the session gets opened when the request is dispatched and closed when the JSP finishes rendering
14:46 sfisque i cant hang long, packing up.  but if you're still chasing this asynch stuff.   look at using ajax + rest.  you can decouple the request / response and do your processing decoupled from the response and atomicize your responses
14:46 Naros allowing the JSP to trigger lazy loads.
14:46 acuzio I think you are just escaping Guest47243 questions  Naros
14:47 Naros How am I escaping his question?
14:47 Guest47243 Naros,       User user = new User();. thats in service class.       how to make hibernate also load user.getSomeListOfItems() also when user is instantiated.     i see it does not unless getLists is explicitly called. but user.getName IS avaialable no matter you getName later on
14:47 Naros A collection is mapped as @OneToMany which per JPA spec is lazily loaded.
14:47 Guest47243 Naros,  dont mind acuzio
14:47 Naros lazily loaded can only work when you have a JDBC connection which is dictated by YOUR (the developer) transactional demarcations.
14:47 Guest47243 acuzio,  take it easy :)
14:48 Naros Which is generally on your service methods
14:48 acuzio Guest47243: I am just not sure why no one can answer your questions really
14:49 Naros Perhaps the issue isn't those answering but your receptiveness of the responses.
14:49 Guest47243 acuzio,  answering questions is not compulsory on any one here. its done by self interest
14:50 Naros Guest47243: in your scenario, using new User() implies a non-attached (aka non-managed entity).  There isn't a way to load anything until the object gets persisted to the ORM
14:50 Guest47243 acuzio,  and I have been satisfied with the answers :)
14:50 acuzio well then its ok -
14:50 Guest47243 acuzio,  thanks for the support ! :)
14:50 acuzio does it mean you are not going to use 8 * 2000 threads ?
14:50 Naros I think what you meant to ask Quest was this
14:50 Guest47243 acuzio,  well we are doing that  8 * 2000 and it is working fine. but definately its not the best strategy
14:50 Naros given a dao method that gives you back a User entity, how do you initialize a collection of subentities maintained by that User entity right?
14:51 Naros Hibernate offers the static method initialize to do just that.
14:51 Guest47243 am. how should i
14:51 Naros Hibernate.initialize(user.getSomeListOfItems());
14:51 acuzio Naros: Eager Loading - do i win a prize ?
14:51 sfisque careful with eager though
14:52 sfisque there are situations where eager can be pathalogical
14:52 Naros You can also query the User via HQL and use fetch join too (which is one way to eager load).
14:52 Naros you can also toggle the collection's fetchmode using criteria api
14:52 Naros specifying both eager and subselect modes.
14:52 Naros er, either eager or subselect.
14:53 Naros what i prefer when you have a complex domain model with these subcollections you want loaded is to use HQL and some fetch joins with the new operator :P
14:54 Naros SELECT new myContainerObject(fieldA, fieldB, fieldC, fieldD) from EntityA fetch join EntityB where ...
14:54 acuzio Naros: sfisque : i dont use hibernate
14:54 acuzio or any ORM for that matter
14:54 Naros Quest does :P
14:55 Naros If you aren't using an ORM, then you're using native SQL which is basically INNER/OUTER joins depending on needs
14:55 sfisque i will rejoin in a bit.  code strong!
14:55 Naros see ya
14:55 acuzio Straight SQL (via JDBCTemplate) --> Cache --> REST/JSON or Socket/ProtoBuf (depending on need) - JS or thick client depending on need
14:56 Naros Right, so you can pass whatever SQL and its parsed by the database, not some middleware layer.
14:56 acuzio All reads and writes are from/to cache
14:56 acuzio Naros: precisely -
14:56 acuzio Naros: DB;'s have been optimized for exactly that - why try and re-invent the wheel
14:57 Naros In quest's case, he's using Hibernate to my understanding, so he can either 1) use native SQL which isn't portable or 2) use HQL or Criteria API and allow Hibernate to convert it to the native SQL based on his configurations.
14:57 acuzio HQL, Criteria API is shit - everyone should know that by now -
14:57 acuzio it was shit in 2005 , no excuse for using it in 2013
14:57 Naros ORMs are designed to allow the developer to not be so concerned with JDBC and gives you portability.
14:57 acuzio Naros: when was the last time you changed DB;s mid-stream
14:58 acuzio Naros: I work in Finance
14:58 Naros It isn't just a concept of changing databases midstream.  It can also be upgrading from say Oracle 8i to 11g or SQL Server 2000 to SQL Server 2005 or 2008 or 2012 :P
14:59 Naros Just because you're on the same major platform doesn't mean the SQL optimzations aren't different per version.
14:59 Naros But as a matter of fact I moved from Oracle 8i to SQL Server 2k8 just 3 years ago mid-development because of support reasons.
14:59 acuzio Trading apps ,  primarily Options or Cash products  - ., in 10 years i have never had to change DB in the middle of a project .,  once we had to upgrade the DB Oracle x.1 to Oracle x.2  ., the effort to upgrade included the cost for optimizing the SQL for that specific version
14:59 acuzio This is basic
15:00 acuzio In any serious environment - this is just basic standard stuff
15:01 Naros ORMs aren't the answer to every project naturally, but they do reduce the cost and increase speed-to-value if you understand how to use them appropriately.
15:03 Naros I've found them personally to be excellent for massive domain models, our indirect materials ERP solution for example.
15:04 acuzio ERP - argh]
15:04 Naros hehe, that's my world today :P
15:05 acuzio Naros: good luck  , avoid slashing your wrists
15:05 acuzio E_PS04A9 CREATE/ALTER TABLE: You cannot create a REFERENTIAL constraint on table 'infringement_tasks' in schema 'rtoldba' because the database to which it belongs is being journaled, but the data in the table itself is not being journaled. (Tue O
15:05 acuzio ct  1 15:16:31 2013)
15:05 acuzio This error is reported when you try to add a constraint to a table that is not journaled in a database that is journaled.
15:05 acuzio Currently in production table infringement_tasks is journaled. The rtol database is also journaled.
15:05 acuzio By dropping the table first and recreating it, journaling is disabled by default.
15:05 Naros o.O
15:05 acuzio shit
15:06 acuzio apologies
15:06 acuzio I am dealing with moronic DBA's
15:06 Naros lol
15:07 Naros Writing an ERP solution with an ORM hasn't been bad at all
15:07 Naros Been quite a nice change of pace from my last job :)
15:20 __nh__ joined ##javaee
15:28 pdurbin huh, ran into "DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory" when trying to deploy our main app to glassfish and the fix was to undeploy another app (that uses oiosaml.java-11220.jar) ... something about xalan from what I can tell at https://java.net/jira/browse/GLASSFISH-11638
15:33 __nh__ joined ##javaee
15:55 sfisque joined ##javaee
15:55 * sfisque flexes and roars
16:00 pdurbin huh. and now I get that same error if I try to deploy the app that uses oiosaml. this was working before
16:00 sfisque what error is that?
16:00 * Naros giggles at sfisque.
16:01 pdurbin the DTDDVFactory one ^^
16:01 * sfisque sighs
16:01 sfisque you're going to make me surf the log.  okaaaay.....
16:03 sfisque oh yeah.  i've not gotten that same thing, but similar issues.  it's generally trouble if you have to bundle xml providers in a webapp.  different version/impls don't play nicely in a container from what i've experienced, regardless of the specific impl
16:03 pdurbin yeah, that's what people seem to say
16:05 Guest47243 .java classes are often given detailsl with /** */ . and @author etc. how can I see how to do that in a good way? what keywords to search on?
16:08 Naros Eclipse allows you to quickly add comments using templates
16:08 Naros other ides may offer similar things
16:17 sfisque aye, if you start a method comment with /** and hit return, netbeans will auto expand it to include the boilerplate attributes for a proper javadoc
16:18 sfisque i believe idea and eclipse do the same
16:19 Naros yep, but eclipse will add them automatically when you add getter/setters and file templates add them when you create classes, interfaces, etc.
16:20 sfisque nice
16:20 Naros never used netbeans but i guess might do it too
16:20 tjsnell nah
16:20 tjsnell use Eclipse or better, Idea
16:20 Naros lame :P
16:20 sfisque only if you start typing one, then it auto expands
16:20 tjsnell lame?
16:21 * sfisque agrees
16:21 Naros yah netbeans not doing it
16:21 Naros that's lame :P
16:21 tjsnell oh
16:21 tjsnell heh
16:21 sfisque if you are auto generating mutator/accessors it should add the boilerplate jdoc
16:21 Naros like being able to create a class with stock comments, etc.
16:21 Naros copyright, blah blah :P
16:21 sfisque my real desired feature that i miss from idea,  select a class, and auto generate a subclass
16:22 tjsnell accessors shouldn't need javadoc over the boilerplate the javadoc tool auto gens
16:22 sfisque you can put the preamble in the template
16:22 sfisque right but netbeans doesnt even stub that far
16:22 tjsnell why'd you leave idea?
16:22 sfisque the company i was working at owned the license and it's fairly heavy in cost
16:22 sfisque netbeans == free
16:23 tjsnell ahh
16:23 tjsnell I have several licenses
16:23 sfisque plus, unless they've improved the engine in the last few years, idea was dog slower than netbeans on a macintosh back then
16:23 tjsnell and in the end get it free too as an apache committer
16:23 tjsnell it's quite snappy now
16:23 tjsnell better than eclipse, not sure about netbeans
16:28 sfisque right now, with nightly builds, i find that if i do not set the memory footprint, netbeans is a little sluggish.  if i fix the memory heap/pg/etc.  it runs smoothly but stalls every so often.  which i can handle more than a general sluggishness
16:31 tjsnell I guess it helps having a fast machine and lots o ram
16:34 pdurbin sfisque: so I can deploy each app separately but can't have them both running at the same time in the same instance of glassfish (domain1)
16:36 sfisque sounds about right
16:36 pdurbin sfisque: and thank for looking at the log earlier :)
16:36 pdurbin thanks*
16:36 sfisque i'm guessing each one does "bad things" like static initializers or "non stateless" objects being instantiated in a "bad place"
16:36 pdurbin hmm. ok
16:37 sfisque i'm guessing each one has a factory object, and those factory objects are doing something that makes the other one unhappy
16:38 pdurbin sfisque: when I need to get this working for real, I'll bug you. I should switch gears and write some docs for the release we're finishing up :)
16:39 sfisque kk
16:39 sfisque :-)
16:39 neuro_sys stateful
17:10 babaj joined ##javaee
17:25 __nh__ joined ##javaee
18:47 __nh__ joined ##javaee
19:28 acuzio joined ##javaee
19:28 kinabalu joined ##javaee
19:44 __nh__ joined ##javaee
19:59 __nh__ joined ##javaee
20:36 SoniEx joined ##javaee
20:38 kinabalu joined ##javaee
21:53 mabsalhi joined ##javaee
21:54 mabsalhi hello
21:56 mabsalhi question : how can i refresh an entity related collection list ??
21:57 Naros do you mean entityA contains a List<EntityB> and you want to refresh that list of a particular entityA instance?
21:58 mabsalhi yes that's it
21:58 mabsalhi the entire example is :
21:59 sfisque when you say "refresh", does that mean you want to discard any changes and get fresh from DB? or you just want them merged into the current persitence context?
22:00 mabsalhi entity A have many related entity B, whaen i added (attach) a new B entity to a i want A be refreshed with a new collection containing the last added
22:00 sfisque how are you persisting "b".  are you persisting it directly? or are you inserting it into the collection and merging "a"
22:01 mabsalhi directly
22:01 Naros eep
22:01 sfisque you might want to revisit that methodology then
22:01 Naros I would prefer insert into entityA's list of Bs and persist entityA
22:01 * sfisque nods with Naros
22:01 mabsalhi ok
22:01 Naros er merge entityA if you prefer
22:02 mabsalhi i will rethink my methodologie
22:02 Naros otherwise, you would need to refresh entityA from the database after the insert of entityB and that could be highly expensive depending on the data held by the entityA instance (e.g. multiple collection bags, etc.)
22:02 sfisque either way, you want "a" in the current pers context, so that any mods (like inserting "b" into it) are persisted when you traverse the transaction boundary (aka, leaving an ejb method)
22:03 sfisque not only that, you can create dirty read/write issues if the objects are being concurrently mod'ed
22:03 Naros very true.
22:04 mabsalhi tha't s exactely what i m facing
22:04 sfisque assuming your graph is annotated @Version appropriately
22:04 mabsalhi i have multi users modifing the same data
22:04 mabsalhi this is a student management application
22:04 sfisque yeah, i had this issue to recently.  person was persisting child directly then that child was getting "whacked" in a later operation
22:04 Naros multiple users modifying the same data is a different beast tho.
22:05 Naros depending on the context in which you mean modifying the same data :P
22:05 mabsalhi i give you the example, it s verry interesting
22:05 * Naros grins at whacky children.
22:06 mabsalhi a student 'joe' have 4 modules
22:07 mabsalhi two professors inserts their marks on a seperate material
22:07 mabsalhi if the sum is more than 20
22:07 mabsalhi the student passed the test
22:07 mabsalhi otherwise it fail
22:08 * sfisque chuckles at naros
22:08 Naros in this case is entityA = the student and entityB the marks created by the professors?
22:08 mabsalhi yes
22:08 mabsalhi tha t s it
22:09 mabsalhi and the situation of the student is changing in the time
22:09 Naros k; imo you might want to make sure that professor2 can't modify student 'joe' while professor1 is making their marks :)
22:09 mabsalhi i have a boolean attribute
22:09 sfisque @Version
22:09 mabsalhi fail tha t will be calculated
22:09 crimsonfubot sfisque: An error has occurred and has been logged. Please contact this bot's administrator for more information.
22:09 Naros lol
22:09 mabsalhi yes i use @version
22:10 sfisque you'll get a concurrent exception if they both attempt to persist. first one wins
22:10 Naros Precisely, that was my concern and wanted to make sure you had considered this scenario.
22:10 mabsalhi yes i have solved that s business problem with a message
22:10 mabsalhi and logging this for admin
22:10 sfisque @eatme_crimsonfubot
22:10 crimsonfubot sfisque: Error: "eatme_crimsonfubot" is not a valid command.
22:11 * Naros rolls on the floor laughing at sfisque.
22:11 mabsalhi i will test the method evoqued by sfisque
22:12 mabsalhi thank 's
22:12 Naros Pessimistic locks are fun to play with (not related to mabsalhi).
22:12 mabsalhi i go back !!
22:12 sfisque np, and give naros some love on that too, he shared :-)
22:12 mabsalhi thaaaaaaaaaaaaaaaaank s to naros
22:12 mabsalhi you are verry helpful
22:12 Naros lol - you're most welcome!
22:12 mabsalhi thank you
22:13 mabsalhi and thanks to balusc
22:13 mabsalhi ;)
22:13 sfisque hah, name dropper!
22:13 sfisque :P
22:13 Naros and with that, it is time to drive home and make dinner :3
22:13 sfisque be well
22:13 * sfisque waves to naros
22:13 Naros until tomorrow !!!!
22:14 * Naros waves at sfisque.
22:14 Naros ciao!

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

Please see http://irclog.greptilian.com/javaee for which days have been logged.