Win a copy of Spring Boot in Practice this week in the Spring forum!

Ioan Damian Sirbu

Greenhorn
+ Follow
since Dec 22, 2008
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 Ioan Damian Sirbu

Greetings all,

I am using the classic AOP approach to transaction management in my application with pointcuts on facade and dao methods.


However, I also want to execute another method, something like UserManager.sendUserId() right after the transaction manager opened a transaction, each time it opens a new transaction.

I tried - without any success - to place pointcuts on AbstractPlatformTransactionManager and on Spring's JmsTransactionManager. (maybe these classes cannot be proxyed?).

Basically all I need is to intercept when a transaction gets opened.
Is there any way I could achieve this?

Thank you in advance!
11 years ago
I tried passing the nested function as a varchar parameter and it's obviously not working
Greetings,

My question is related to another topic, posted here https://coderanch.com/t/495533/Spring/Spring-JDBC-ORACLE-Looking-way#2231065

Let's say I have an ORACLE function which accepts VARCHAR parameter


I want to pass to this function another function that returns a VARCHAR2

FUNCTION get_name RETURN VARCHAR2



Basically, instead of passing directly the parameter, I want to chain them like this


Is it doable with JDBC?

Thanks
There must be a way.

ORACLE has a stored function made for this one purpose: converting int to booleans


Maybe pass it as a function from JDBC?


12 years ago
Greetings all.
My question is not strictly related to Spring's JDBC but since this is what I use at the moment, here it comes..

I want to call an ORACLE stored procedure that has as second parameter a BOOLEAN parameter.

PROCEDURE run_job(job_name IN VARCHAR2,
use_current_session IN BOOLEAN DEFAULT TRUE);



I am calling it like this


My problem is a known one, ORACLE does not have a 'real' boolean type and so it simulates it with integers.
I tried registering "USE_CURRENT_SESSION" parameter as boolean, integer, tried with java.sql types, oracle.jdbc types - all for nothing.

I don't want to make a workaround for this, like wrapping the procedure. I want a correct, programmatic way of passing a boolean to a stored procedure.

If someone can help me with an idea I would be grateful.

Thank you





12 years ago
No, it was my fault.. I posted wrong.
By matching (.*document.*), I was capturing the whole expression. If the input was "calendar simple", the
lookahead (.*simple.*) would have nothing left to match.
The correct pattern would be (calendar)(?!.*simple.*). This would return true for "calendar" or 'calendar some words", but false for "calendar simple".

I tested this with the RegexTestHarness in the Sun tutorials.



PS: Now that I think I got how this works, I am trying to combine lookahead with lookbehind




12 years ago
Thank you, I actually found a good tutorial right here http://www.javaranch.com/journal/2003/04/RegexTutorial.htm
For whoever is interested, the regex should look like this
((.*calendar.*)(?! .*simple.*))
12 years ago
I was giving an arbitrary example.
The concrete situation is:
- I need to make a search in Eclipse in all files.
- I need to find the files that contain a custom tag that is like this <input type="calendar"> but is not like <input type="calendar" theme="simple">

I think that using Eclipse's regex matches are an option, and in the same time this regex dilemma is interesting by itself
12 years ago
Greetings,

I have a problem with finding a regex pattern that should match any text containing a group of letters, and in the same time it does not contain another group of letters.
Iterating a file line by line, I need to extract the lines containing the word 'input', AND not containing the word 'type'.
So, 'input damian whatever' is a match, while 'input damian type whatever' is not.

Any ideas?
12 years ago
I would expected that the compiler would give at least a warning

Thank you all for your help!
Thank you, I suspected it but I was not sure.
So basically, adding an unchecked exception in a method's declaration has absolutely no effect.
Hello everyone,

I am trying to understand a situation that occurs when implementing a method in an interface and throwing a wider exception type.

Declaring an exception in SudetImpl does not compile and it's OK,because the overriding method can NOT declare wider exceptions


The weird thing comes next: when StudentImpl.speak() throws RuntimeException, the code compiles



In my opinion, there is absolutely no dfference - StudentImpl.speak() throws RuntimeException, while Student.speak() does not.
It should throw a compiler error... and yet, it does not


If someone could enlighten me regarding this, I would be really grateful.

Thanks
Thanks for the answers.
I don't intend to fail the exam, but it's nice to know I have a safety net
Hello everyone!

I have purchased some time ago a SCJP 1.5 voucher with a free retake option.
From what I understand, a minimum of 7 days were required before retaking the exam.
Quoting from the certification page:

Sun's Certification Retake Rules:

* There is a 7-day minimum wait period before retaking a failed exam.
* You can retake the same exam a maximum of three (3) times in one calendar year.
* After the third failed attempt within one calendar year, you must obtain written permission from Sun prior to attempting a fourth time by sending an email request to suncert_ww@oracle.com.
* An exam cannot be retaken once it has been passed.



However, in JavaRanch FAQ writes that this period is 2 weeks.

My voucher expires on 30 april and I want to know that, if I attend it on 20, 21 or 22 april I still have time to retake it, if needed.

Thank you