Sugantha Jeevankumar

Ranch Hand
+ Follow
since Jun 06, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sugantha Jeevankumar

Hi Everyone

For those who missed the last session, a new session is scheduled to start on 15th of September, 2014. Hope you make the best use of it.
10 years ago
Thanks Jeanne.. I have indeed decided to use JDBC for this.. Thanks for the tip on avoiding clash with live EJB instances..
Hi All.. Here is what I am trying to achieve.. I have my application that uses entity beans as ORM. I am trying to bulk delete rows of a very large table, via entity bean CMP. I understand that the code would look something like this...,



In my case, the collection rowsToDelete (which would be populated by a finder) would have close to a million records. Would this create as many objects in the EJB pool? Would'nt this exhaust my EJB container's heap? Is this why the docs advise against the usage of findAll()..

For your info, I use JBoss 6.0.0 with EJB 2.0. If bulk delete such as the above is problematic, I am looking for a way to fetch only a limited number of records, say 500 iteratively and delete records. As far as I checked, this option is available in EJB 3.0 but not in EJB 2.0. So, how do I accomplish a delete in this case. Any ideas or pointers are appreciated.
Thanks Jaikiran.. I was hoping there would be a non-intrusive way to do this, since I need to check the isolation level in use in a production machine. Any more suggestions are welcome.
11 years ago
Hi All.. I just want to know if there is a way to display the actual transaction isolation level used by my JBoss datasource. My datasource configuration looks like below,



I understand MySql uses TRANSACTION_REPEATABLE_READ by default and I am trying to override it with TRANSACTION_READ_COMMITTED for all transactions originating from my application. Is there anyway to check, if the datasource is indeed using TRANSACTION_READ_COMMITTED. JBoss' JMX console did not show much under "name=template/datasource,service=DataSourceBinding" node and server.log also did not reveal much. Any help is appreciated.
11 years ago
Thanks all. Though I dont speak Italian at all, I did get your explanation. I have already decided to ditch the 'use-regex-entirely' approach, and working towards writing a manual parser, that takes the help of a little regex now and then.

@Winston
Like you said, I am trying to parse an expression with a lot of braces, quotes and other characters. One positive is, this is not free flowing text. These are pre-defined expressions (written by the developer), that are read in from XML files. And I will be trying to handle misbehaving expressions with nested quotes etc in the parser.


Thanks all for your help.
12 years ago
@Henry
Thanks a lot. That works. Although I would like to know how the output differs between


I see that only the ordering of the lookbehind and lookahead around the '|' differs. Can you please explain the regex.

@Winston
Yes, Though it begins to look a little complex, the complexity ends there. So I think so far, regex does nicely. And there is no possibility of nested quotes in the input.
12 years ago
@Richard
Thanks for the idea.. I tried the following code to match the text between single quotes,



For this, I get,



"aaa bbb", "eee" and "ggg " do not get returned. Is there a way to return the non-matched string via the Matcher class in any way?
12 years ago
Hi All.. I need to do a regex split on a string like "aaa bbb 'ccc ddd' eee 'fff' ggg" and split this into the following,



i.e I need to split the text within the single quote character. I had attempted this with (zero width positive look-behind for ') OR (zero width positive look ahead for '), i.e., "(?<=')|(?=')" but the result it gives me is this,



Previously, I had posted a similar question, https://coderanch.com/t/592655/java/java/Regex-split-characters-return-delimiters where I am splitting around an open brace and a closed brace. When a similar logic is applied here, I understand that the same single quote is being matched by both the look-behind and the look-ahead, making it appear as a separate token. Can you please point me on how to get my kind of output ? Thanks in advance.

12 years ago
That works great.. and now I also understand how.. Thanks Darryl
12 years ago
I can ignore the leading and trailing whitespaces. The regex pattern I have tried out in my previous post is positive lookahead, I guess. Do you mean my delimiter would only be "{" if I use the zero-width positive lookahead. I am completely out of depth in regex, so if "zero-width positive lookahead" is the way to go, I would search more on this.

@Richard
I was just working out a reply to your post
12 years ago
Hi Ranchers.. I need to do a regex split on a string like "aaa bbb {ccc ddd} eee {fff}" and split this into tokens like here,

aaa bbb
{ccc ddd}
eee
{fff}



The approach I have attempted is to use the "opening brace-any character-closing brace" trio as the delimiter. And to get to my kind of output I need to return the delimiter! The closest I have got to the result is with this: "(?=(\\{([^}]*)\\}))" using the positive lookahead in an attempt to return the delimiter. This yields me this result,

aaa bbb
{ccc ddd} eee
{fff}



Googling around I learnt that Perl makes it easy to return delimiters while pattern matching but I am yet to find anything straightforward in java. If not possible, I may need to resort to manual parsing of the string. Please send in your suggestions. Thanks all !!
12 years ago
Hi.. I just came across this conflicting way of defining interfaces by java.

An interface can be given public or default access, but not private or protected access. Trying to compile the below code,

gives,
test.java:1: modifier protected not allowed here
protected interface test{}

whereas

compiles just fine

The question is why. It makes sense to prevent an interface being private. But since protected is a 'broader' specifier than default, an interface should logically be allowed to be protected I think. What is your opinion?
13 years ago
Have you tried if JTree or swingx.JXTree suits your needs.. or can be customized?
13 years ago
Migrating to Java 6 is not in the cards since this is a legacy application and customer expects support in JRE 5.

Anybody who has faced a similar issue with look and feel or someone who has worked with java 5 in Windows 7, please suggest some pointers on what can be done. Currently, I am clueless.
13 years ago