Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Prashant Neginahal

Ranch Hand
+ Follow
since Sep 14, 2002
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 Prashant Neginahal

Hi,

I am confused with meaning of default namespace and targetNamespace in XML schema.

In the below example the default namespace is com.prashu.java.xml.jaxb and I have declared 2 elements Employee and Address. I have NOT provided the targetNamespace. The schema validation is failing when i try to refer the Address element from Employee, it is asking either define targetNamespace or remove defaultnamespace.

Can anyone please explain me the reason behind this?


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns="com.prashu.java.xml.jaxb" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Employee">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element ref="Adress"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Adress">
<xs:complexType>
<xs:sequence>
<xs:element name="Address1" type="xs:string"/>
<xs:element name="Address2" type="xs:string"/>
<xs:element name="City" type="xs:string"/>
<xs:element name="PinCode" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

Thanks in advance.

Regards,
Prashant
Hi All,

I am executing a sybase stored procedure from Java. I am explicitly raising an error in sybase stored proc using 'raiseerror @ERRORCODE, @ERRORMSG'. But if I execute this using callablestmt.execute() I am NOT getting any SQLException, however if I execute using callablestmt.executeUpdate() then i will get SQLException with error code and error message whatever i had given in the stored proc.

Please somebody help in undrastanding difference between these two.

Thanks and Regards,
Prashant
Hi Guys,

Is there any way to find out JMS queue depth programatically?

Thanks and Regards,
Prashant
Hi Valentin,

Thanks for your time. Since i am new to Sybase, please give me some links to undestand these PCC and OCC.

But i set the row level locking using following command.

ALTER TABLE <tablename>
LOCK DATAROWS command.

even then, the behaviour is not changed.

Please advice me.

Thanks and Regards,
Prashant
Guys,

I am really stuck in this problem. Please help.

We are using Sybase database. As i mentioned in the shown example it is handing the database once response from queue delayed. The problem is with Sybase, even for insertion it is locking entire table.

Is there any way to not to lock table if transaction getting delayed in committing.

Thanks and Regards,
Prashant
Hi Guys,

I have some problem with EJB transactions. The code looks something like this...

ejbMethod(){
// database insertion using DAO
// publishing message using JMS
}

ejbMethod has transaction attribute *Required*. The problem is sometime JMS goes down i.e become really slow in responding. In this case, the particular table where we are inserting a record using DAO helds up and nobody can access that table. Is there anything like we can configure to release the database soon.

Please do respond.

Thanks and Regards,
Prashant
All bean interfaces SessionBean, EnterpriseBean and MessageDrivenBean declares ejbRemove() method. So in all bean classes bean provider has to implement ejbRemove() method.
Bhilla,

Why do u think answer is d? When u execute ut.setRollbackOnly(), the transaction is marked for rollback. And, after executing commit(), the container sees that this transaction is marked for rollback, so will not commit it.

Thanks,
Prashant
Hi Guys,

Thanks to everybody in this forum. The HF is too good(thanks to Kathy and Bert) to understand the fundamentals but i guess this is not enough. I would like thank Sawan Parihar who really answered my most of the questions.

I prepared for 3 months and studied
-- HF,
-- Spec(studied using valentine's spec-objective mapping). I guess this is what helped me a lot.
-- Mikalai's notes
-- Did couple of mock tests

Exam was bit easy just couple of tough questions. I faced tough questions in EJB QL.

Once again thanks a lot guys!!!

Regards,
Prashant
14 years ago
I came across a question which says following is correct answer.

public void ejbCreate(String userid) throws InvalidUseridException
{
if(userid.length() == 0) throw new InvalidUseridException(userid);
}

But should it NOT ejbCreate() always throw CreateException?

Thanks,
Prashant
Hi Guys,

How does the Container acknowledges when tx attribute for CMT MDB's onMessage() is "NotSupported"? Because in this case, it runs in unspecified transaction context and Container acknowledges only when tx is committed.

Thanks,
Prashant
I am bit confused with JNDI implementation.

Lets say I deploy a bean with jndi name "jndi/mybean".
For this bean lets say I have defined a environment variable with jndi name as "java:/comp/env/empName".

My question is with respect to JNDI implementation. Are these two part of same JNDI tree? How does server differntiate between these two?

Thanks,
Prashant
Guys,

I dont know whether this is right group for this question.

System.out.println("Hello");

This will print on the console. I want this display either to be colored or blinking. Is there any way in java(API) to do this?

Thank you very much.

--Prashant
15 years ago
Guys,

How to know that whether a not-null connection is a valid connection?
Valid i mean, it should execute statements. I dont want to execute any statments and then get exception and then come to know that connection is NOT valid.

if(conn != null){
// Is there any check to know that this connection is valid.
}

Thanks,
Prashant