Minor Annoyance

View: New views
8 Messages — Rating Filter:   Alert me  

Minor Annoyance

by RogerV :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm using EclipseLink 1.1 within Eclipse Galileo IDE. Everything is working fine, however Eclipse insists in marking the sources containing my entities (@Entity) as being in error. The sources all show "Table <name> cannot be resolved" although as I said everything actually works at run time.

This means that every time I try to run anything, unit tests, save to subversion etc, the IDE prompts me with the "Project contains errors" dialog and asks if I want to continue. Of course, these show as errors in the Problems view as well.

This is slowly driving me nuts. Does anyone know what's triggering this behaviour and how to stop it.

Regards

Re: Minor Annoyance

by Shaun Smith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Roger,

   What's happening is that Dali is using the database connection you specified on your JPA project to validate your mappings against the database schema.  If you open the properties of the project and go to Java Persistence you can change the connection to <None>.  With no connection Dali will not validate against the database and the error you see will go away.



  However, what I think you should do is change the connection to point to the target database schema you're building for so that you can benefit from Dali's validation.   If you're getting validation errors but it works at runtime then the Dali design time connection and the runtime connection info in the persistence.xml must be different or the two databases must contain different schemas.

    Shaun

RogerV wrote:
I'm using EclipseLink 1.1 within Eclipse Galileo IDE. Everything is working
fine, however Eclipse insists in marking the sources containing my entities
(@Entity) as being in error. The sources all show "Table <name> cannot be
resolved" although as I said everything actually works at run time.

This means that every time I try to run anything, unit tests, save to
subversion etc, the IDE prompts me with the "Project contains errors" dialog
and asks if I want to continue. Of course, these show as errors in the
Problems view as well.

This is slowly driving me nuts. Does anyone know what's triggering this
behaviour and how to stop it.

Regards
  

--
Oracle
Shaun Smith | Principal Product Manager
Phone: +19055023094
Oracle Server Technologies, Oracle TopLink
ORACLE Canada | 110 Matheson Boulevard West, Suite 100, Mississauga, Ontario | L5R 3P4

Green Oracle Oracle is committed to developing practices and products that help protect the environment




_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Minor Annoyance

by RogerV :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Shaun

Thanks for the response. Your suggestion was wrong about the connection information but is correct in that there was a mismatch between Eclipses' view and Dalis' view of things and the issue is a discrepancy between the entity class names, the @Entity(name="") annotation, the @Table(name="") and the actual name of the database table. and it was all about which ones started with an uppercase letter and which started with a lowercase letter. I'm using mySQL and for some reason insists on creating the tables with a lowercase first letter and I can't rename the tables through the admin functions. Once I'd got everything matching .... although I'm surprised that anything worked at all given the name mismatch

Regards



Shaun Smith wrote:
Hi Roger,

   What's happening is that Dali is using the database connection you
specified on your JPA project to validate your mappings against the
database schema.  If you open the properties of the project and go to
Java Persistence you can change the connection to <None>.  With no
connection Dali will not validate against the database and the error you
see will go away.



  However, what I think you should do is change the connection to point
to the target database schema you're building for so that you can
benefit from Dali's validation.   If you're getting validation errors
but it works at runtime then the Dali design time connection and the
runtime connection info in the persistence.xml must be different or the
two databases must contain different schemas.

    Shaun

RogerV wrote:
> I'm using EclipseLink 1.1 within Eclipse Galileo IDE. Everything is working
> fine, however Eclipse insists in marking the sources containing my entities
> (@Entity) as being in error. The sources all show "Table <name> cannot be
> resolved" although as I said everything actually works at run time.
>
> This means that every time I try to run anything, unit tests, save to
> subversion etc, the IDE prompts me with the "Project contains errors" dialog
> and asks if I want to continue. Of course, these show as errors in the
> Problems view as well.
>
> This is slowly driving me nuts. Does anyone know what's triggering this
> behaviour and how to stop it.
>
> Regards
>  

--
Oracle <http://www.oracle.com>
Shaun Smith | Principal Product Manager
Phone: +19055023094
Oracle Server Technologies, Oracle TopLink
ORACLE Canada | 110 Matheson Boulevard West, Suite 100, Mississauga,
Ontario | L5R 3P4
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to
developing practices and products that help protect the environment

_______________________________________________
eclipselink-users mailing list
eclipselink-users@eclipse.org
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

AW: Minor Annoyance

by Mathias Walter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I had the same problem and found out that Dali is case sensitive for all
database objects (e. g. database name, table name and column names). In
contrast, MySQL is only case sensitive for database and table names, but not
for column names.
Is it possible to tell Dali that it should use the correct case sensitivity
depending on the underlying database vendor?

According to the MySQL docs: "Column, index, and stored routine names are
not case sensitive on any platform, nor are column aliases. Trigger names
are case sensitive, which differs from standard SQL."

--
Kind regards,
Mathias

> -----Ursprüngliche Nachricht-----
> Von: eclipselink-users-bounces@... [mailto:eclipselink-users-
> bounces@...] Im Auftrag von RogerV
> Gesendet: Donnerstag, 5. November 2009 16:46
> An: eclipselink-users@...
> Betreff: Re: [eclipselink-users] Minor Annoyance
>
>
> Hi Shaun
>
> Thanks for the response. Your suggestion was wrong about the connection
> information but is correct in that there was a mismatch between
> Eclipses'
> view and Dalis' view of things and the issue is a discrepancy between
> the
> entity class names, the @Entity(name="") annotation, the
> @Table(name="") and
> the actual name of the database table. and it was all about which ones
> started with an uppercase letter and which started with a lowercase
> letter.
> I'm using mySQL and for some reason insists on creating the tables with
> a
> lowercase first letter and I can't rename the tables through the admin
> functions. Once I'd got everything matching .... although I'm surprised
> that
> anything worked at all given the name mismatch
>
> Regards
>
>
>
>
> Shaun Smith wrote:
> >
> > Hi Roger,
> >
> >    What's happening is that Dali is using the database connection you
> > specified on your JPA project to validate your mappings against the
> > database schema.  If you open the properties of the project and go to
> > Java Persistence you can change the connection to <None>.  With no
> > connection Dali will not validate against the database and the error
> you
> > see will go away.
> >
> >
> >
> >   However, what I think you should do is change the connection to
> point
> > to the target database schema you're building for so that you can
> > benefit from Dali's validation.   If you're getting validation errors
> > but it works at runtime then the Dali design time connection and the
> > runtime connection info in the persistence.xml must be different or
> the
> > two databases must contain different schemas.
> >
> >     Shaun
> >
> > RogerV wrote:
> >> I'm using EclipseLink 1.1 within Eclipse Galileo IDE. Everything is
> >> working
> >> fine, however Eclipse insists in marking the sources containing my
> >> entities
> >> (@Entity) as being in error. The sources all show "Table <name>
> cannot be
> >> resolved" although as I said everything actually works at run time.
> >>
> >> This means that every time I try to run anything, unit tests, save
> to
> >> subversion etc, the IDE prompts me with the "Project contains
> errors"
> >> dialog
> >> and asks if I want to continue. Of course, these show as errors in
> the
> >> Problems view as well.
> >>
> >> This is slowly driving me nuts. Does anyone know what's triggering
> this
> >> behaviour and how to stop it.
> >>
> >> Regards
> >>
> >
> > --
> > Oracle <http://www.oracle.com>
> > Shaun Smith | Principal Product Manager
> > Phone: +19055023094
> > Oracle Server Technologies, Oracle TopLink
> > ORACLE Canada | 110 Matheson Boulevard West, Suite 100, Mississauga,
> > Ontario | L5R 3P4
> > Green Oracle <http://www.oracle.com/commitment> Oracle is committed
> to
> > developing practices and products that help protect the environment
> >
> > _______________________________________________
> > eclipselink-users mailing list
> > eclipselink-users@...
> > https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> >
> >
>
> --
> View this message in context: http://old.nabble.com/Minor-Annoyance-
> tp26208613p26215768.html
> Sent from the EclipseLink - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@...
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

How to get only valid session instance

by Sebastien Tardif-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Does EclipseLink has an API to retrieve session instance in a way that
their invalidation flag is respected, so that the instances are
refreshed before being returned to the caller?

Of course their references/children should also have their invalidation
flag respected.
_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: AW: Minor Annoyance

by Neil Hauge :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dali attempts to handle case-sensitivity in a vendor specific way based on the database information available.  It is possible that there are some holes in this support, specifically in the case of MySQL, due to their varied treatment of case on different operating systems and database objects.

MySQL folds database and table names to lowercase on Windows by default, but this default can also be changed by the lower_case_table_names variable.  On Unix, database and table names would be case sensitive by default since sensitivity is determined by the underlying filesystem.

The following page explains MySQL treatment of case in greater detail, which may be of help:
http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html

It might be necessary for Dali to have a general "Ignore case" option for database object resolution that can be set by the user to override our vendor specific settings if we cannot reasonably support all of the possibilities.  In any case, I suggest that you enter a bug against Dali for this case (1) and/or continue this discussion on the Dali forums (2) for additional assistance.

(1) https://bugs.eclipse.org/bugs/enter_bug.cgi?classification=WebTools
(2) http://www.eclipse.org/forums/eclipse.technology.dali

Thanks,
Neil

Mathias Walter wrote:
Hi,

I had the same problem and found out that Dali is case sensitive for all
database objects (e. g. database name, table name and column names). In
contrast, MySQL is only case sensitive for database and table names, but not
for column names.
Is it possible to tell Dali that it should use the correct case sensitivity
depending on the underlying database vendor?

According to the MySQL docs: "Column, index, and stored routine names are
not case sensitive on any platform, nor are column aliases. Trigger names
are case sensitive, which differs from standard SQL."

--
Kind regards,
Mathias

  
-----Ursprüngliche Nachricht-----
Von: eclipselink-users-bounces@... [...-
bounces@...] Im Auftrag von RogerV
Gesendet: Donnerstag, 5. November 2009 16:46
An: eclipselink-users@...
Betreff: Re: [eclipselink-users] Minor Annoyance


Hi Shaun

Thanks for the response. Your suggestion was wrong about the connection
information but is correct in that there was a mismatch between
Eclipses'
view and Dalis' view of things and the issue is a discrepancy between
the
entity class names, the @Entity(name="") annotation, the
@Table(name="") and
the actual name of the database table. and it was all about which ones
started with an uppercase letter and which started with a lowercase
letter.
I'm using mySQL and for some reason insists on creating the tables with
a
lowercase first letter and I can't rename the tables through the admin
functions. Once I'd got everything matching .... although I'm surprised
that
anything worked at all given the name mismatch

Regards




Shaun Smith wrote:
    
Hi Roger,

   What's happening is that Dali is using the database connection you
specified on your JPA project to validate your mappings against the
database schema.  If you open the properties of the project and go to
Java Persistence you can change the connection to <None>.  With no
connection Dali will not validate against the database and the error
      
you
    
see will go away.



  However, what I think you should do is change the connection to
      
point
    
to the target database schema you're building for so that you can
benefit from Dali's validation.   If you're getting validation errors
but it works at runtime then the Dali design time connection and the
runtime connection info in the persistence.xml must be different or
      
the
    
two databases must contain different schemas.

    Shaun

RogerV wrote:
      
I'm using EclipseLink 1.1 within Eclipse Galileo IDE. Everything is
working
fine, however Eclipse insists in marking the sources containing my
entities
(@Entity) as being in error. The sources all show "Table <name>
        
cannot be
    
resolved" although as I said everything actually works at run time.

This means that every time I try to run anything, unit tests, save
        
to
    
subversion etc, the IDE prompts me with the "Project contains
        
errors"
    
dialog
and asks if I want to continue. Of course, these show as errors in
        
the
    
Problems view as well.

This is slowly driving me nuts. Does anyone know what's triggering
        
this
    
behaviour and how to stop it.

Regards

        
--
Oracle <http://www.oracle.com>
Shaun Smith | Principal Product Manager
Phone: +19055023094
Oracle Server Technologies, Oracle TopLink
ORACLE Canada | 110 Matheson Boulevard West, Suite 100, Mississauga,
Ontario | L5R 3P4
Green Oracle <http://www.oracle.com/commitment> Oracle is committed
      
to
    
developing practices and products that help protect the environment

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


      
--
View this message in context: http://old.nabble.com/Minor-Annoyance-
tp26208613p26215768.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
    

_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
  


_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: AW: Minor Annoyance

by RogerV :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>
>  MySQL folds database and table names to lowercase on Windows by default,
>  but this default can also be changed by the lower_case_table_names
>  variable.  On Unix, database and table names would be case sensitive by
>  default since sensitivity is determined by the underlying filesystem.
>

Aah! Thanks for the confirmation. I'd been wondering about that - my
development environment is Windows & deployment is Unix. Fortunately,
EclipseLink seems to be case-agnostic, otherwise nothing would;ve worked!

Regards
_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

RE: How to get only valid session instance

by Sebastien Tardif-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm researching a solution because I think the API has nothing to
respect validity flag.

Our use case is using object marked read-only, but read via UOW, then
because the object is marked read-only, reading via UOW is like reading
directly from session cache, so invalidation flag is never respected.
The read-only flag has no other value in EclipseLink than providing some
performance gain, but most likely introduce unthread safe use case.

What I want to change is that invalidation flag be respected but still
keep the optimizations, and I don't care it's not thread safe.

So please tell me if I'm going to break something if I do the following:
- remove read-only flag
- still read via unit of work
- use custom InstantiationCopyPolicy that always provide clone and
backup that is self
- use custom DeferredChangeDetectionPolicy that never calculate any
changes, always returning no change


-----Original Message-----
From: eclipselink-users-bounces@...
[mailto:eclipselink-users-bounces@...] On Behalf Of Sebastien
Tardif
Sent: Thursday, November 05, 2009 11:56 AM
To: EclipseLink User Discussions
Subject: [eclipselink-users] How to get only valid session instance

Does EclipseLink has an API to retrieve session instance in a way that
their invalidation flag is respected, so that the instances are
refreshed before being returned to the caller?

Of course their references/children should also have their invalidation
flag respected.
_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users