Moderator (MDR): MDR-Andrea
Guest-Speaker (SPK): SPK-Linda and SPK-Sally
MDR-Andrea: Hello and welcome to Java Live. Today's topic is
JavaTM BlendTM. Our guests are product manager Sally Sheward and
project lead Linda DeMichiel. Please feel free to send in your questions.
Before we get to those, I'd like to start by asking one myself. What is Java
Blend and how is it useful for devleopers?
SPK-Sally: Java Blend is a development tool and runtime that
automatically integrates JavaTM applications with relational data. You can
either map an existing database to Java classes or a set of Java classes into a
relational database schema. Java Blend saves developers lots of time writing
the integration pieces themselves.
vkareddy: How are the relations between tables mapped
to classes?
SPK-Linda: Foreign keys (FKs) in the database are mapped in
various ways, depending on the exact nature of the FK relationship. For example,
join tables (where there are two FKs, each referencing a "different" table)
will be mapped to many-many relationships between Java classes. If the primary
key (PK) of one table is a FK to the primary key of another table and those PKs
are the same, then that relationship will be captured, in terms of inheritance,
between the Java classes. Other cases will be modeled as one-one or one-many
relationships between Java classes, as appropriate, and so on. Of course all of
this is customizable, and can be controlled on a case-to-case basis or by
setting global defaults.
vkareddy: How is concurrency handled by Java Blend?
SPK-Sally: Java Blend defaults to optimistic concurrency,
though pessimistic is available as an option on a per-transaction basis.
spen007: When is the scheduled availablity of Java
Blend, and what will be the price?
SPK-Sally: Java Blend will be available this quarter. The
pricing has not been announced yet.
vkareddy: Does it use JTS?
SPK-Sally: Java Blend does not use JTS.
fmundt: Does Java Blend have the ability to
dynamically create objects and connect them to a database? I am looking for
the ability to create a list of names for a combo box. For example, I don't
want to create a complete list of employees in order to fill a drop-down list
box with names.
SPK-Linda: The mapping between classes and tables must take
place in advance. Once the mapping has been established, instances of those
classes can be added to the database dynamically.
nkapasi: Does Java Blend support transactions?
SPK-Linda: Yes, both optimistic transactions and pessimistic
transactions.
jdnash: Does Java Blend support nested transactions?
SPK-Linda: We will support nested transactions, although
probably not in our first release.
ericye: Is Java Blend a server, or just a set of
APIs? I am wondering how to deploy applications developed with Java Blend.
SPK-Sally: Java Blend is not a server, nor "just" a set of
APIs. It is a development tool and a runtime. To deploy your application using
Java Blend, you need to include the runtime libraries with your completed
application. These libraries contain the caching, transaction processing, and
query processing.
So, do your development using the tool to create the connections between
database data and Java objects, add your business logic, include the runtime
libraries, and deploy.
fmundt: Will Java Blend support any database
connectivity other than JDBCTM?
SPK-Linda: Not in the short term, but perhaps in the long term.
ericye: I attended your
JavaOneSM presentation on Java Blend. My
understanding is that Java Blend technology is targeting enterprise computing,
which has characteristics of distributed, powerful back-end computing.
Currently I am developing a component-based server that doesn't have
complicated database schema. But performance for processing user requests is
critical. Writing JDBC code is not so tedious due to its simple data model.
The question is: Will using Java Blend result in a performance penality? If so,
should I stay with JDBC only?
SPK-Sally: Since we are still in Beta, performance questions
are difficult to answer. We think that the performance will be at least as good
as JDBC and better in some cases.
jdnash: Can I instantiate a persistent object when a
transaction is not active?
SPK-Linda: Operations on persistent objects must occur within
the scope of a Java Blend transaction.
nkapasi: Is it possible to map an object to two
distributed databases?
SPK-Linda: The first release Java Blend will handle access to
only a single database at a time. In a future release will we handle access to
multiple databases.
mzimmerm: I am wondering if Java Blend is an IDE by
itself. Are there any plans to integrate it with JavaTM WorkShopTM?
SPK-Sally: Java Blend is not an "IDE" by itself. We do have
plans to make Java Blend easily usable in IDEs, including Java WorkShop.
ashishagrawal: I am currently evaluating O2, which is
a similar product to Java Blend. However, it does not provide mapping for long
strings (it is database dependent). Do you have a similar problem in Java Blend?
SPK-Sally: If I understand your question, Java Blend does not
have the same issue. We map long varchars.
ashishagrawal: For example, a String which could be
arbitary length could easily be mapped to a Sybase databse transparently even
though it has a limit for varchar fields.
SPK-Linda: Java Blend assumes a fixed mapping between the
class field type and database column type. So, if a String were mapped to a
varchar column, then the String could not have arbitrary length. Once we
support Blobs, Clobs, etc., however, such limits will go away. But obviously
blobs and clobs are more expensive from a database point of view.
jdnash: Are mapping packages specific to a given
RDBMs (Oracle, Sybase, etc.) or is there one package for all databases?
SPK-Sally: Applications created using Java Blend are portable
across databases. You can buy one version of Java Blend for all databases.
nkapasi: Is Java Blend going to be a part of
JDKTM at some point in time? What are the licensing issues in redistributing
the runtime libraries?
SPK-Sally: Java Blend is a standalone, binary product and will
not be a part of the JDK. As I mentioned before, pricing has not yet been
released, so I can't answer the runtime licensing question.
vkareddy: How does it do transactions? Can you
explain it?
SPK-Linda: Pessimistic transactions are handled by opening a
transaction on the database (and holding database locks) for the duration of
the Java Blend transaction. For optimistic transactions, we don't hold database
locks until the commit phase processing of the Java Blend transaction, when we
verify that the database values Java Blend has been operating on are consistent
with the database state.
vkareddy: Does Java Blend use JDBC or something else?
SPK-Sally: Currently Java Blend uses JDBC for database access.
ericye: How does Java Blend manage connenctions to a
database? Internally, does it use connection pool with a configurable number or
establish connections on demand?
SPK-Linda: We maintain a connection pool.
ericye: Is Java Blend implemented with 100% Pure
JavaTM code?
SPK-Sally: Java Blend is all in the Java language, and we are
seeking 100% Pure Java certification. Applications developed with Java Blend
can be 100% Pure; our runtime is all in the Java language.
jdnash: Do transaction semantics operate on transient
attibutes within persistent objects, or only on persistent attributes?
SPK-Sally: Transient attributes are not transactional.
vkareddy: Does it use JDBC 2.0 or the earlier versions?
SPK-Sally: Java Blend uses JDBC drivers implementing the JDBC
specification. No drivers are available that support 2.0 yet.
fmundt: The white paper talks about a single data
model for database information and normal transient program data. How does Java
Blend model transient data?
SPK-Linda: Mapped classes can have transient attributes.
However, these attributes are not mapped to the database.
spen007: You do support caching of objects. Can
multiple users access the same objects in the cache? If so, does Java Blend
notify users when an object in the cache changes?
SPK-Sally: Currently the cache is a per-transaction cache and
is not shared.
nkapasi: Does Java Blend require some storage (on a
database or file system) for its mapping information?
SPK-Linda: Yes, the mapping information is persistent.
vkareddy: Can we map any data type to any data
typefor example, int to floator they are specific to SQL types?
SPK-Sally: You can customize the mapping of datatypes.
vkareddy: Can we have more than one active
transaction at the same time?
SPK-Linda: Absolutely.
ashishagrawal: Are you using reflection to work out
the structure of the object, or does a person have to define a
interface/inherit from a base class, or is it done on the fly as requests are
made?
SPK-Linda: None of the above, actually. Classes whose objects
you wish to make persistent need to be mapped to the database first. During the
mapping phase, not only is the structure of the objects figured out, but also
their relationship to the database structures.
veran: What's the advantage of using Java Blend
compared to object databases?
SPK-Sally: Java Blend is for developers writing Java
applications that need to access relational databases. Often companies have
lots of existing data in RDBMSs that they want to leverage with new
applications, or they want to leverage existing investments in RDBMSs to
persist Java objects. Java Blend makes this easy to do. Not all companies want
or are ready to shift to ODBMSs. If you write your application using Java Blend,
the code is portable to an ODBMS, if you decide to change over later.
jdnash: Concerning references to objects within other
objects (e.g. reference to a child with a parent object), is the child
de-referenced when the parent is instantiated, or only when the child is
referenced?
SPK-Linda: Either way. We provide a prefetch option that
allows you to specify how you would like this to occur, on a
per-class/reference basis.
srangarajan: Can attributes within a Java class be
mapped to fields in tables across different databases? This may be necessary
to compile information from two or more databases and consolidate the
information in a single data repository.
SPK-Linda: Java Blend currently handles mapping to only a
single database at a time. We are looking at this functionality for a future
release.
ericye: Enterprise JavaBeansTM (EJB) components
are likely to be used with database access. Does or will Java Blend work well
within the EJB framework? Any plans on this?
SPK-Sally: Yes, Java Blend will work well within the EJB
framework. As examples, think of using classes created by Java Blend from an
existing database to make Enterprise JavaBeans components that have access to
databases. Another example would be using Java Blend as the persistence
mechanism for EJB components themselves in the EJB server.
jdnash: Does Java Blend provide any reporting tools?
SPK-Sally: Java Blend is a tool for developing applications
that access databases. You could write a reporting tool application using
Java Blend, but Java Blend itself is not a reporting tool.
vkareddy: If we use pessimistic transactions, are the
objects accessed in one transaction available for the other transactions? If so,
are there any restrictions?
SPK-Linda: The cached objects are not accessible by another
Java Blend transaction.
ericye: JavaBlend is based on JDBC. So JDBC is
required, which means you need JDK 1.1 or later. Are any other packages are
required in order to use Java Blend?
SPK-Sally: You need JDBC and the JDK. Of course, at runtime
you will need a JVM.
jdnash: Are any utilities provided to load Java
objects into a database?
SPK-Linda: Not in the first release.
ericye: RMI are threaded APIs. How can I ensure that
use of Java Blend is thread-safe? Does Java Blend ensure that?
SPK-Sally: Java Blend is built for use in multi-threaded
environments. You can use RMI calls in an application written using Java Blend.
jdnash: Can you briefly describe your optimistic
locking design, and how one codes for conflicts?
SPK-Linda: Optimistic concurrency is of course "optimistic"
because it isn't holding locks on the database data. When an optimistic
transaction is about to commit, Java Blend verifies the database state is
consistent with the state that would have resulted had the database locks been
held. If so, the Java Blend transaction writes its changes to the database and
commits. If not, a RetryException is raised. The Java Blend
transaction is rolled back, so that the persistent objects that were updated
during the transaction are restored to the values that they had at the
beginning of that transaction. You can catch the RetryException
and retry your Java Blend transaction.
vkareddy: Can we share the connection established by
Java Blend to do some database access using JDBC?
SPK-Linda: Yes. Java Blend allows you to fall through to JDBC.
jdnash: Any support for schema evolution?
SPK-Sally: Yes. Java Blend allows you to pull changes in the
database schema into the Java application without disturbing all the
customizations and business logic you have added.
fmundt: Will the developer have the ability to extend
Java Blend to use other data storage mediums (e.g., flat files, mainframe
connectivity, CICS transactions, MQ series, etc.)?
SPK-Linda: We are planning to extend Java Blend to use other
data storage mediums, although not in the first release.
BarclayJ: How is Java Blend's performance?
SPK-Sally: I'm in marketing; the performance is excellent. :-)
MDR-Andrea: Well, we've run out of time. I'd like to thank
everyone for joining, especially Sally and Linda. Watch
the schedule for
upcoming Java Live forums. Thanks and see you next time.