Time |
S |
Nick |
Message |
02:23 |
|
|
Technodrome joined ##javaee |
05:53 |
|
|
Technodrome joined ##javaee |
06:50 |
|
|
AlexCzar joined ##javaee |
10:47 |
|
|
scripty joined ##javaee |
10:48 |
|
scripty |
Well i get messed with query languages |
10:52 |
|
|
Technodrome joined ##javaee |
11:43 |
|
|
Technodrome joined ##javaee |
12:53 |
|
|
AlexCzar left ##javaee |
12:53 |
|
|
AlexCzar joined ##javaee |
13:38 |
|
|
Technodrome joined ##javaee |
13:43 |
|
|
Naros joined ##javaee |
14:06 |
|
|
jieryn joined ##javaee |
14:06 |
|
|
jieryn joined ##javaee |
14:46 |
|
|
Quest joined ##javaee |
14:59 |
|
|
Naros joined ##javaee |
15:03 |
|
Quest |
the crawl() finishes its job in about 2 - 5 seconds for one thread in reallity. I have 11 threads running in context to http://oi43.tinypic.com/2cpcbuq.jpg . now why its taking 5,555,481ms which is 2 hours |
15:05 |
|
pdurbin |
that's a lot of ms |
15:05 |
|
Quest |
yup |
15:06 |
|
acuzio |
pdurbin: is it because the program is sentient ? |
15:06 |
|
Quest |
and the ms is increasing. |
15:07 |
|
acuzio |
is it ms or pms ? |
15:08 |
|
Quest |
it says ms |
15:09 |
|
Naros |
Perhaps you have some deadlock or race condition with your code? |
15:10 |
|
Quest |
that method just clrawls a webpage each time |
15:10 |
|
acuzio |
i think the p might be silent - it is clearly a sign of pms |
15:12 |
|
Naros |
What if you run 2 or 5 threads rather than 11? |
15:12 |
|
Naros |
Generally speaking if single threaded code works but adding secondary threads don't - the first place I look is shared resources |
15:12 |
|
Naros |
perhaps a lock isn't being released that you otherwise think does |
15:12 |
|
Quest |
now i would just run 1 thread and let you know |
15:12 |
|
Quest |
one sec |
15:13 |
|
Naros |
yah always make sure single threaded works first before adding multi-threading to the picture :) |
15:14 |
|
acuzio |
no no - if its pms nothing really matters |
15:14 |
|
|
WileTheCoyot joined ##javaee |
15:14 |
|
acuzio |
you lose anyway |
15:14 |
|
Quest |
50,000ms |
15:14 |
|
WileTheCoyot |
hello everyone |
15:14 |
|
Naros |
Hi Wile. |
15:15 |
|
Quest |
100,000ms |
15:15 |
|
WileTheCoyot |
is there a way using sendredirect to redirect instantly? |
15:15 |
|
Quest |
150,000ms |
15:16 |
|
Naros |
Redirects are handled by the client. |
15:16 |
|
Naros |
So you're at the mercy of the browser :) |
15:16 |
|
Quest |
WileTheCoyot, redirect a webpage? |
15:16 |
|
WileTheCoyot |
yes |
15:16 |
|
Quest |
WileTheCoyot, you can if no other content is loaded. |
15:16 |
|
Naros |
But is a redirect necessary in your case is the bigger question. |
15:16 |
|
WileTheCoyot |
i'm implementing a simple login jsp |
15:17 |
|
Quest |
WileTheCoyot, you can if no other content is loaded. (by html) and redirect anytime by dispatcher |
15:17 |
|
Quest |
if using servlets based thing |
15:17 |
|
Naros |
That's one way Quest, but using a redirect relies on the browser sending a follow up request for the login url. |
15:17 |
|
Quest |
Naros, 300,000ms |
15:17 |
|
WileTheCoyot |
if a session attribute is null redirect to login.jsp |
15:18 |
|
Naros |
Another way is to have your code write the login stuff when a session isn't valid rather than the requested resource. |
15:18 |
|
WileTheCoyot |
later in the page i have a welcome message using session variables |
15:18 |
|
Naros |
For example in Struts, we return "login" to have the framework render the login form based on session criteria. Otherwise it renders the original content to the browser. |
15:18 |
|
WileTheCoyot |
now the first time i go to the page |
15:18 |
|
WileTheCoyot |
a got null pointer exception |
15:19 |
|
WileTheCoyot |
because the session attribute is null |
15:19 |
|
Naros |
Are you using Servlets or some web framework? |
15:19 |
|
WileTheCoyot |
just pure jsp and servlet |
15:19 |
|
Quest |
WileTheCoyot, if(seesion.getAttribute(...) == null) { request.getdispatcher().redirect(). bla bla check the correct syntax though.} |
15:20 |
|
WileTheCoyot |
istead of using request.getdispatcher().redirect() i'm using sendredirect |
15:20 |
|
WileTheCoyot |
let me pastebin |
15:20 |
|
Naros |
Quest: these times mean little to me other than implying it is still running of course. |
15:20 |
|
Quest |
why the time shown is so huge |
15:21 |
|
Quest |
than actual |
15:21 |
|
Naros |
To crawl a particular web site (if you mean get links and prepare a search database like google) should only take a few seconds for a site of small size. |
15:21 |
|
Quest |
500,000ms |
15:21 |
|
WileTheCoyot |
http://pastebin.com/qQdKaRrW |
15:21 |
|
WileTheCoyot |
the first time i open this page i got null pointer exception |
15:22 |
|
Naros |
I'm not aware of your particulars Quest regarding what the crawl is doing and how much data you have your thread processing to conclude anything regarding the runtime numbers. |
15:23 |
|
acuzio |
Naros: its pms |
15:23 |
|
acuzio |
i think thats where we are all making a mistake |
15:24 |
|
Quest |
k |
15:24 |
|
Naros |
My comments to multi-threading remain accurate regardless :P |
15:26 |
|
Quest |
hm |
15:27 |
|
Naros |
run the code for a single data-set (1 site) and collect statistics. |
15:27 |
|
Naros |
increase the work load and determine the time in a single threaded scenario |
15:27 |
|
Naros |
then determine whether threading is viable and what the optimal thread settings should be |
15:28 |
|
WileTheCoyot |
i debugged it and sendredirect is executed |
15:28 |
|
Naros |
WileTheCoyot: Greate. What that ultimately does is asks the browser to request your login.jsp. Naturally how fast that occurs is dependent on network load and client system load. Make sense? |
15:29 |
|
Quest |
Naros, http://pastebin.ca/2466620 i see line 75 print at an interval of 2-5 seconds in a single threaded application but the live result profiler in netbeans says that it takes 900,000ms for crawl() |
15:29 |
|
Naros |
browser requests your first page, page sends redirect request to browser, browser requests the new page = 2 requests to your server. |
15:30 |
|
WileTheCoyot |
Naros: i am on localhost |
15:30 |
|
Naros |
That doesn't matter beyond how fast your network traffic is :P |
15:31 |
|
Naros |
The browser reacts the same way regardless. |
15:31 |
|
Naros |
Send redirect basically sends a 3xx HTTP response code to the browser with a URL location of your login.jsp which causes the browser to send a HTTP request for that page in a secondary request. |
15:33 |
|
WileTheCoyot |
Naros: ? |
15:33 |
|
Naros |
I'm just describing to you what your send redirect java code does at the HTTP layer :) |
15:33 |
|
WileTheCoyot |
ah ok |
15:34 |
|
Naros |
Redirects are great, but they're not always the right tool for these types of jobs. With what you're working with at the moment, they're not many alternatives but you'll find others as you progress into using web frameworks. |
15:35 |
|
Naros |
Most frameworks allow you to do this kinda thing without needing to ask the browser to request a new page which is nice for bandwidth. |
15:36 |
|
Naros |
Quest: a few things |
15:37 |
|
Naros |
Have you checked whether the putEmailsInDB is your bottleneck? |
15:38 |
|
Naros |
I also wouldn't be constructing BasicDAO repeatedly as you do either :P |
15:38 |
|
Naros |
construct it once perhaps at the start of the crawler thread and reuse the same instance. |
15:38 |
|
Naros |
that won't address your core issue atm but its just a formality |
15:39 |
|
Quest |
Naros, I just commented out //putEmailsInDB |
15:39 |
|
Quest |
os sorry^ |
15:39 |
|
Quest |
disregard |
15:39 |
|
Naros |
Does commenting that out make a difference in speed? |
15:39 |
|
Quest |
Naros, well ether way... why the actual time is <5 seconds and the said as 900,000ms |
15:39 |
|
Quest |
i see line 75 print at an interval of 2-5 seconds in a single threaded application but the live result profiler in netbeans says that it takes 900,000ms for crawl() |
15:40 |
|
Naros |
perhaps as acuzio said maybe netbeans UI is wrong, IDK |
15:40 |
|
Quest |
hm |
15:40 |
|
Quest |
ok |
15:40 |
|
Quest |
I would investigate |
15:40 |
|
Quest |
thanks :) |
15:41 |
|
Naros |
im not a netbeans fan so :P |
15:41 |
|
Quest |
hm |
15:43 |
|
Naros |
Can you explain tho for my own understanding why you new BasicDAO like you do? |
15:44 |
|
Naros |
I generally allocate stuff a thread needs either prior to running the thread or at the start of the thread's execution phase and deallocate it when I'm done to minimize overworking the GC |
15:47 |
|
|
Technodrome joined ##javaee |
15:48 |
|
Quest |
Naros, that is a big flaw. |
15:48 |
|
Naros |
not necessarily 'big' cause I'm sure the code works |
15:48 |
|
Quest |
BasicDao should be a field variable. and all mehods should be call ing basicDAo.method() instead of new Basic dao everytime |
15:48 |
|
Naros |
Yep |
15:49 |
|
Quest |
i have done that but didnt noticed and performance betterment |
15:49 |
|
Naros |
That kinda stuff is a pet-peeve of mind coming from a C++ world where memory allocation, particularly in tight loops is extremely taboo |
15:49 |
|
Quest |
i had no c++ skills by the way |
15:50 |
|
Naros |
That's fine, its just a good rule of thumb to allocate once, reuse the instance until it no longer is needed then discard it is all. |
15:51 |
|
Naros |
Since your class is a runnable, you could allocate BasicDAO in your main program, pass it as a constructor to the crawler and reuse the same instance across all your threads since the BasicDAO should be thread safe by nature. |
15:51 |
|
Quest |
yes |
15:52 |
|
Naros |
:) |
15:52 |
|
Quest |
exactly |
15:52 |
|
Naros |
In the spring world anyhow, Services, Repositories (aka daos) are all singletons anyway :P |
15:53 |
|
Quest |
hm |
16:14 |
|
Quest |
what do you use for logging and writing errors to txt files? |
16:14 |
|
whartung |
java.util.logger |
16:16 |
|
pdurbin |
Quest: someone is unable to join ##javaee because of an IP block: http://www.evanchooly.com/logs/%2523glassfish/2013-10-14 |
16:30 |
|
* Naros |
concurs with whartung. |
16:30 |
|
tjsnell |
slf4j and logback |
16:31 |
|
whartung |
To be fair, I use a wrapper around it that makes it easier to use, but since JUL is the "logger de jour" in GF, we use that. |
16:33 |
|
Naros |
Yep |
17:16 |
|
Quest |
pdurbin, hm ok. ill fix that |
17:17 |
|
pdurbin |
Quest: thanks |
17:20 |
|
Quest |
pdurbin, fixed |
17:21 |
|
Quest |
whartung, util.logger hmm.. I would have to differentiate the features of util.logger, log4j and slf4j . |
17:21 |
|
Quest |
I do not know what each would give me. |
17:22 |
|
Quest |
I think each would just make some file opened up. text file. and keeps writing on it when a debug/error or custom print is called up. |
17:22 |
|
Quest |
I did something fooling. make a custom logger class that wrote the log in some txt file. each time the text file was opened and closed. and that can also be some huge bottle neck too |
17:22 |
|
tjsnell |
that's base functionality for any of them |
17:22 |
|
Quest |
tjsnell, ^ |
17:23 |
|
Quest |
so whats the main difference between log4j , slf4j and util.Logger class |
17:23 |
|
tjsnell |
slf4j is the successor to log4j |
17:24 |
|
tjsnell |
util.logger is the sun/oracle defacto and loved by few |
17:24 |
|
|
scripty joined ##javaee |
17:24 |
|
Quest |
successor ? whats that? |
17:24 |
|
scripty |
? |
17:26 |
|
Quest |
tjsnell, you mean slf4j uses log4j in its backend? |
17:26 |
|
scripty |
Any one uses vi ? |
17:26 |
|
Quest |
scripty, nano. |
17:26 |
|
scripty |
LOL kiddy :D |
17:27 |
|
Quest |
scripty, and #Linux would be a better place for either |
17:27 |
|
|
johnkozak84 joined ##javaee |
17:27 |
|
tjsnell |
Quest: the guy who wrote log4j later devloped slf4j as an improvement |
17:27 |
|
Quest |
ah. i see |
17:28 |
|
Quest |
tjsnell, I wonder why why why then so many people use log4j. even apache....... |
17:28 |
|
tjsnell |
why do people use windows? |
17:28 |
|
Quest |
tjsnell, no intellegent today uses window |
17:28 |
|
tjsnell |
both log4j and slf4j are apache projects |
17:28 |
|
Quest |
intelligent* |
17:29 |
|
Quest |
tjsnell, then why apache itself uses log4j in more than 90% of its products. just a guess on the percentage |
17:29 |
|
Quest |
if slf4j is a better thing . ^ |
17:29 |
|
tjsnell |
legacy |
17:29 |
|
tjsnell |
cost of switching isn't free |
17:30 |
|
Naros |
that's like asking why are some developers still using Visual Studio 2005 to make native windows applications :) |
17:30 |
|
Quest |
I assume slf4j has more features and is stabler/faster |
17:30 |
|
Quest |
tjsnell, i see |
17:30 |
|
* scripty |
-> Quest your quite a mod :P |
17:30 |
|
Quest |
Naros, got your point. as same as tjsnell 's point |
17:30 |
|
tjsnell |
the latest disrupter code in log4j has it ahead speed wise |
17:30 |
|
Naros |
Cost is a big factor, both monetarily and productivity wise. |
17:30 |
|
Quest |
scripty, mod? |
17:31 |
|
Quest |
tjsnell, oh you mean the latest disrupter code in log4j makes it faster than slf4j? |
17:31 |
|
tjsnell |
yeah |
17:31 |
|
Quest |
tjsnell, hm.. |
17:31 |
|
tjsnell |
http://www.javacodegeeks.com/2013/07/log4j-2-performance-close-to-insane.html |
17:31 |
|
Quest |
tjsnell, i would just do a google comparison b/w slf4j and log4j though, whats your favorite? |
17:32 |
|
tjsnell |
if startign from scratch slf4j since it's just a facade |
17:32 |
|
tjsnell |
and logback usually |
17:32 |
|
scripty |
slf4j :) |
17:33 |
|
scripty |
hey pdurbin |
17:33 |
|
Quest |
hm. fans of slf4j here... |
17:34 |
|
Quest |
any big reason? |
17:34 |
|
Quest |
despite log4j is much faster |
17:34 |
|
tjsnell |
speed isn't always critical |
17:34 |
|
pdurbin |
scripty: hey |
17:34 |
|
Quest |
hm |
17:34 |
|
tjsnell |
and you can use log4j with slf4j |
17:34 |
|
Quest |
tjsnell, then slf4j must be having more features |
17:35 |
|
tjsnell |
it's easy to read up on |
17:35 |
|
scripty |
Quest google it |
17:35 |
|
Quest |
k |
17:35 |
|
Quest |
what about utils.Logger then? |
17:35 |
|
tjsnell |
bleh |
17:35 |
|
Quest |
its just one class. |
17:35 |
|
tjsnell |
who cares |
17:36 |
|
Quest |
how it is compared to the 2 discussed |
17:37 |
|
scripty |
pdurbin, whatzz up ? |
17:38 |
|
Quest |
tjsnell, Naros one thing is for sure. log4j or slf4j wants seperate i nstance for each class. like Logger = Logger(className.class); and they keep the files opened up (dont close them) and keep writing the logs |
17:38 |
|
tjsnell |
they don't want that |
17:38 |
|
tjsnell |
you can use one global logger |
17:38 |
|
tjsnell |
but that'd be seriously stupid |
17:39 |
|
Quest |
stupid? why? |
17:40 |
|
tjsnell |
exactly the same reason as last week when you asked exactly the same question |
17:40 |
|
Quest |
tjsnell, its stupid to make one global logger and call it from each class is just because the log will not show the class name and line number from which the error/info came? |
17:40 |
|
Quest |
tjsnell, I recalled^ |
17:43 |
|
pdurbin |
scripty: no school. home with the kids. dinking with our new digital piano: http://irclog.perlgeek.de/crimsonfu/2013-10-14#i_7713174 |
17:44 |
|
scripty |
:D |
17:45 |
|
|
kobain joined ##javaee |
17:45 |
|
* scripty |
says perl is a Devil |
17:46 |
|
pdurbin |
scripty: you're not the first |
17:46 |
|
* scripty |
i'm with Monaid |
17:48 |
|
sess |
Quest: slf4j isnt about features or speed |
17:49 |
|
sess |
it's just a logging API without implementation in itself |
17:49 |
|
sess |
it enables clients of your work to use any logging framework they want |
17:50 |
|
Quest |
sess, oh. so whats the implementation? |
17:50 |
|
tjsnell |
you choose |
17:50 |
|
sess |
you pick one |
17:50 |
|
tjsnell |
it's a facade |
17:51 |
|
sess |
sl4j works with log4j |
17:51 |
|
sess |
or java util logger |
17:51 |
|
sess |
or something else |
17:51 |
|
sess |
its only purpose is to seperate your code from the logging implementation |
17:51 |
|
sess |
your code just says "i want to log an info message with this text, i dont care what happens to it" |
17:51 |
|
sess |
and the client just plugs in the implementation of their choice |
17:51 |
|
Quest |
sess, so log4j is one implementation ? |
17:51 |
|
sess |
yes |
17:52 |
|
Quest |
ok |
17:52 |
|
sess |
imagine if you use 5 libraries, one uses log4j, one uses java.util.logger, the 3 others uses their own shit |
17:52 |
|
sess |
imagine the chaos of trying to get output from everything |
17:52 |
|
sess |
while if all 5 uses slf4j, you can use whatever implementation you want |
17:53 |
|
sess |
that said, using straight up log4j for example isnt really bad when making web applications |
17:53 |
|
sess |
slf4j is most important when making components that others will use |
17:53 |
|
Quest |
hm |
17:54 |
|
Quest |
so more generic approach is to use slf4j and then we can have any implementation like log4j or any other |
17:54 |
|
sess |
yeah |
17:54 |
|
sess |
you can think of slf4j as an interface |
17:54 |
|
sess |
it works exactly like one |
17:55 |
|
Quest |
hm |
17:55 |
|
Quest |
but if we use log4j, we only use log4j. period? |
17:55 |
|
sess |
yup |
17:55 |
|
Quest |
I still confusion about: having undertood that. cant the logger auto know that which class called it? i bet it can some how . then why 1. we have to declare logger in EACH class of our app 2. why the class name has to be passed? ("com.foo.Bar"); why not generic? |
17:55 |
|
Quest |
I am talking about the app that does Logger barlogger = Logger.getLogger("com.foo.Bar"); in each of its class |
17:57 |
|
tjsnell |
it's one line of code |
17:57 |
|
tjsnell |
and you've obsessed over this minor nit of a detail for WAY too long |
17:57 |
|
sess |
yeah its not a big deal |
17:58 |
|
sess |
Quest: logger names doesnt have to be the class name |
17:58 |
|
sess |
you can make a logger called foo in a class called bar |
17:58 |
|
Quest |
i know that getLogger will get the same innstance. why call it in each class. i mean why not just import some.super.class.logger and just logger.("message"); why do . Logger barlogger = Logger.getLogger("com.foo.Bar"); in each of its class |
17:58 |
|
sess |
you just define a number of categories, then for each of your classes that wants to lo |
17:58 |
|
Quest |
tjsnell, just getting concept |
17:58 |
|
sess |
you pick a category |
17:58 |
|
sess |
you might want 2 loggers in 1 class |
17:58 |
|
tjsnell |
it's an easy one |
17:59 |
|
sess |
your idea wouldnt work with that |
17:59 |
|
sess |
using class name is just a convention |
17:59 |
|
sess |
not required by the framework |
17:59 |
|
sess |
its 1 line of code that has a good purpose, just leave it at that |
17:59 |
|
Quest |
oh. so the "com.foo.Bar" is just some hashmap table thing . for catagorizing? |
17:59 |
|
sess |
yes |
18:00 |
|
sess |
or no |
18:00 |
|
sess |
not a map |
18:00 |
|
Quest |
hashtable maybe |
18:00 |
|
sess |
its more like a folder structure |
18:00 |
|
sess |
com.foo.bar and com.foo.bar2 are related |
18:00 |
|
Quest |
k |
18:00 |
|
sess |
they will inherit configuration of com.foo |
18:00 |
|
sess |
and com.foo will inherit configuration of com |
18:01 |
|
* scripty |
will be asking lot of newbie questions hope you answer --> |
18:01 |
|
Quest |
i can replace it by "databaseLogs" + "GUI-Logs" and just make these to in each class of my app. that is 2 catagories only. |
18:01 |
|
Quest |
? |
18:01 |
|
sess |
you could |
18:01 |
|
Quest |
hm |
18:01 |
|
sess |
though im not sure if - is allowed |
18:02 |
|
Quest |
it should, according to what you explained |
18:02 |
|
sess |
but it would be a bad idea |
18:02 |
|
Quest |
as its just for giving them a name |
18:02 |
|
sess |
since it goes against convention |
18:02 |
|
Quest |
why,? if i only want 2 catagories of logs |
18:02 |
|
sess |
because other developers looking in your logs |
18:02 |
|
sess |
will expect 1 logger per class |
18:03 |
|
|
Technodrome joined ##javaee |
18:03 |
|
Quest |
k |
18:03 |
|
sess |
and will be confused when there is no databaseLogs class |
18:03 |
|
sess |
following conventions is always preferable unless you have a very good reason to stray from it |
18:04 |
|
Quest |
last question: how to just make one global logger and call it in each class? (without the need to declare logger variable as a field in the class)? |
18:04 |
|
Quest |
though a bad idea^ |
18:04 |
|
sess |
loggers are static |
18:04 |
|
sess |
go figure |
18:04 |
|
Quest |
sess, and what views about util.Logger ? |
18:04 |
|
sess |
you just need a single static method in a class |
18:04 |
|
Quest |
sess, ok. got it |
18:04 |
|
sess |
never used util.logger, but it should be extremly similar to log4j |
18:04 |
|
Quest |
and import static mainClass.Logger; |
18:04 |
|
sess |
since it was designed after log4j |
18:05 |
|
Quest |
OH |
18:05 |
|
Quest |
and ofcourse log4j is better |
18:05 |
|
Quest |
woudl be better |
18:05 |
|
sess |
logging before java 1.3 or something was horrid |
18:05 |
|
Naros |
you could probably come up with a generic class you subclass to avoid that one line of code if it's absolutely that necessary :P |
18:05 |
|
sess |
or didnt exist |
18:05 |
|
sess |
so log4j was made |
18:05 |
|
sess |
then java.util.logger was made |
18:06 |
|
Quest |
Naros, or import static mainClass.Logger; in each class |
18:06 |
|
sess |
Naros: i dont think the superclass could get the name of the subclass in a static context though |
18:06 |
|
whartung |
there was no standard logging originally. Log4j rose to prominence, and JUL was added to 1.4, "inspired" by log4j. |
18:06 |
|
whartung |
Log4j had some notorious bugs. |
18:06 |
|
scripty |
1 ques so we need logger for each class ? |
18:06 |
|
sess |
you dont need any |
18:06 |
|
whartung |
that's the easy way of doing it. |
18:06 |
|
sess |
but you want |
18:06 |
|
sess |
in general |
18:06 |
|
whartung |
Loggers are defined by some tag, convention is to use the class name. |
18:07 |
|
Quest |
hm |
18:07 |
|
whartung |
Whatever name you use is delineated by ".", i.e. this.that.other |
18:07 |
|
whartung |
those dots represent heirarchy |
18:07 |
|
Quest |
whartung, then I can make my own tags if i feel confident |
18:07 |
|
whartung |
so you can set the "test.that" to DEBUG, and all of the children loggers get DEBUG by default |
18:07 |
|
Naros |
yep and those names allow you to disable logging from certain categories (in the defacto naming convention, specific class hierarchies). |
18:07 |
|
whartung |
yes. |
18:08 |
|
sess |
what kind of tag would be better than package.classname? |
18:08 |
|
Quest |
instead of class names. and still get the error line no. and clas name in logs |
18:08 |
|
whartung |
If you look at Glassfish, they have them by functionality (web layer, transaction service, etc.) |
18:08 |
|
jieryn |
anyone else understand jbatch? seriously, what is the value? and it is kind of offensive in how old it "feels" |
18:08 |
|
whartung |
no, you get the name of the logger |
18:08 |
|
jieryn |
why was it added to java ee 7 ? |
18:08 |
|
whartung |
it was added because it's necessary jieryn |
18:09 |
|
Quest |
whartung, yes yes. thats what exactly i wantedhave them by functionality (web layer, transaction service, etc.) |
18:09 |
|
whartung |
yea, you an do that |
18:09 |
|
Quest |
can * |
18:09 |
|
sess |
you already have that |
18:09 |
|
sess |
with your package names |
18:09 |
|
Naros |
^^ |
18:09 |
|
sess |
com.app.web.x |
18:09 |
|
jieryn |
why is it necessary? |
18:09 |
|
sess |
com.app.service.x |
18:09 |
|
sess |
com.app.dao.x |
18:09 |
|
sess |
etc |
18:10 |
|
whartung |
Logger log = Logger.getLogger(LogTag.TRANSACTION_SERVICE) |
18:10 |
|
Quest |
whartung, okay. so to be more generic, slf4j whould be used and implemented by log4j, that way we can change to some other implementation from log4j to something else. is slf4j is the only choice? |
18:10 |
|
sess |
only one that i know of, and it's popular |
18:10 |
|
Quest |
whartung, perfect <whartung> Logger log = Logger.getLogger(LogTag.TRANSACTION_SERVICE) |
18:10 |
|
whartung |
because it's a fundamental processing concept within data processing. We've been doing batch processing since day 1, and it's still necessary. Businesses need to run jobs every day/week/month. |
18:11 |
|
whartung |
correct |
18:11 |
|
whartung |
there's commons.logging |
18:11 |
|
whartung |
but slf4j is better. |
18:11 |
|
jieryn |
how is it any different than @Scheduled ? |
18:11 |
|
Quest |
why its called better? |
18:11 |
|
Quest |
whartung, |
18:11 |
|
Quest |
whartung, you wont recomend using log4j straight up. right |
18:11 |
|
whartung |
it's newer, learned from the past. |
18:11 |
|
jieryn |
log4j2 beats the pants off slf4j |
18:11 |
|
whartung |
no, I wouldn't |
18:11 |
|
Quest |
whartung, hm |
18:12 |
|
whartung |
I would use a wrapper |
18:12 |
|
whartung |
we have our own wrapper around JUL |
18:12 |
|
jieryn |
just use JUL, save yourself the holy war |
18:12 |
|
sess |
Quest: I really think you are focusing on the wrong things in your development |
18:12 |
|
sess |
you seem to put 90% of your time on 10% of the issues |
18:12 |
|
whartung |
JUL needs a wrapper, frankly. |
18:12 |
|
sess |
logging is really not a big deal |
18:12 |
|
sess |
pick something and focus on making your application design great |
18:12 |
|
Quest |
sess, these are my days of learning the roots. once the tree is setup. i will climb fast. |
18:13 |
|
Quest |
sess, but true you are |
18:13 |
|
Naros |
I'm with sess because logging implementations are not that drastic to swap & change downstream. |
18:13 |
|
whartung |
They aren't, they're mostly compatible |
18:13 |
|
Quest |
whartung, JUL == util Logger? |
18:13 |
|
sess |
if youre putting this much effort into logging, the logical thing would be to study hibernate for years |
18:13 |
|
whartung |
the nice thing about JUL is that it's always there |
18:13 |
|
sess |
before writing a query |
18:13 |
|
whartung |
yes |
18:13 |
|
whartung |
if you are writing a library for others (outside your company) to use, I'd use slf4j |
18:14 |
|
Quest |
whartung, hm for a small app. just util.Logger would be fine then |
18:14 |
|
jieryn |
logging is boring unless you're going to automatically @Inject java.util.logging.Log with a Provider<Log> class, now that is sexy ;-) |
18:14 |
|
whartung |
oh, more than adequate |
18:14 |
|
whartung |
heh |
18:14 |
|
Naros |
lol @ jieryn |
18:14 |
|
jieryn |
it seriously is |
18:14 |
|
jieryn |
then you can @Inject your Log instance |
18:14 |
|
* scripty |
EATING POPCORN |
18:14 |
|
Naros |
I can think of sexier things than logging but meh :P |
18:15 |
|
whartung |
I like our logger :) |
18:15 |
|
Quest |
thanks ! |
18:15 |
|
sess |
http://docs.jboss.org/seam/3/3.1.0.Final/reference/en-US/html/solder-logging.html |
18:15 |
|
sess |
i looked at this before |
18:15 |
|
sess |
logging using annotations |
18:15 |
|
sess |
really sexy |
18:15 |
|
sess |
but never got it to work |
18:16 |
|
whartung |
the problem with logging via annotations is that it's just as wordy as without |
18:16 |
|
sess |
in enables reuse |
18:18 |
|
whartung |
So who's the resident JCA expert here? |
18:18 |
|
jieryn |
seriously though, jbatch looks pretty crummy |
18:18 |
|
whartung |
really? I think it looks pretty nice. |
18:18 |
|
jieryn |
WEB-INF/classes/META-INF/batch-jobs ... wtf? |
18:18 |
|
jieryn |
seems pretty stupid |
18:18 |
|
whartung |
Oh, wait, I wrote something almost exactly like it -- perhaps that's why I'm jaded |
18:19 |
|
* Naros |
giggles. |
18:19 |
|
jieryn |
it's like people are just paying lipservice to some folder names |
18:19 |
|
scripty |
+1 jieryn |
18:20 |
|
whartung |
it provided a Known Point to put the job descriptors, wha't the problem with that? |
18:22 |
|
scripty |
Unlike other serverside lang this is bad |
18:23 |
|
whartung |
Obviously, you've never needed this capability. |
18:23 |
|
jieryn |
just put it in /META-INF/batch-jobs |
18:23 |
|
jieryn |
putting it in /WEB-INF/classes/META-INF/batch-jobs makes it look the designers have no damn clue the standard layout of web applications |
18:23 |
|
whartung |
so that's the criticism? That's it? |
18:23 |
|
jieryn |
that's just the aesthetic |
18:24 |
|
whartung |
save that WEB-INF/classes is ALREADY ON THE CLASSPATH and META-INF is not |
18:24 |
|
jieryn |
it doesn't matter if it is on the classpath |
18:24 |
|
whartung |
Mr. Knows-how-wars-are-organized |
18:24 |
|
whartung |
yea, it does |
18:24 |
|
whartung |
since thats how it' getting these resources |
18:24 |
|
jieryn |
it's a stupid specification, the impl can read it from wherever |
18:24 |
|
jieryn |
so get in line jbatch, stop re-inventing everything |
18:26 |
|
whartung |
Yea, why isn't JEE just the servlet spec and be done with it? |
18:26 |
|
scripty |
+1 again |
18:26 |
|
jieryn |
second, they do not integrate with JMS at all |
18:26 |
|
whartung |
how would they integrate with JMS? What does that have to with batch processing? |
18:26 |
|
jieryn |
i should be able to source inputs/outputs to anything like a jms queue, a jpa db, ..anything |
18:27 |
|
whartung |
that's what you're Reader does |
18:28 |
|
whartung |
but JMS doesn't really fit in to the batch pricessing idiom. MDBs handle that already |
18:28 |
|
jieryn |
i need to play with it more, for sure; but it feels flaky |
18:29 |
|
whartung |
why bother, you don't need it, you don't use it, so, there's no reason for it to be here. |
18:33 |
|
jieryn |
i like to know what's available |
18:33 |
|
jieryn |
and to have at least written something with each spec |
18:46 |
|
|
Quest joined ##javaee |
19:03 |
|
pdurbin |
someone at http://illegalargument.libsyn.com/webpage/episode-105-back-from-the-ashes is saying how much he likes Direct Web Remoting: http://en.wikipedia.org/wiki/DWR_%28Java%29 |
19:30 |
|
|
Guest25252 joined ##javaee |
19:30 |
|
|
Pikkenstein joined ##javaee |
19:35 |
|
|
syncsys_ joined ##javaee |
20:08 |
|
|
Pikkenstein joined ##javaee |
20:16 |
|
|
balazare joined ##javaee |
23:26 |
|
|
jieryn joined ##javaee |
23:26 |
|
|
jieryn joined ##javaee |